Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/api: additional file causes spurious API change #10032

Closed
crawshaw opened this issue Feb 28, 2015 · 2 comments
Closed

cmd/api: additional file causes spurious API change #10032

crawshaw opened this issue Feb 28, 2015 · 2 comments

Comments

@crawshaw
Copy link
Member

$ go run $GOROOT/src/cmd/api/run.go

Everything is fine.

$ touch $GOROOT/src/os/junk_arm
$ go run $GOROOT/src/cmd/api/run.go

exit status 1 with:

-pkg os (linux-arm), const O_SYNC = 1052672
-pkg os (linux-arm-cgo), const O_SYNC = 1052672

The only necessary feature of the file is that it has _arm in its name. No contents, no .go suffix.

/cc @bradfitz

@bradfitz
Copy link
Contributor

bradfitz commented Mar 1, 2015

/cc @griesemer since he'll be touching this file soon too.

crawshaw added a commit that referenced this issue Mar 2, 2015
This is a roll forward of 2adc3bd. It occurred to me that we will
want this code on both darwin/arm and darwin/arm64. Removing _arm from
the file name conveniently avoids #10032.

Change-Id: I3a96a3e7020907d9307af8f696e26ad55b2060f0
Reviewed-on: https://go-review.googlesource.com/6460
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
@rsc rsc added this to the Go1.5Maybe milestone Apr 10, 2015
@rsc rsc modified the milestones: Unplanned, Go1.5Maybe Jun 29, 2015
@iwdgo
Copy link
Contributor

iwdgo commented Jan 3, 2023

Incidentally verified while working on api tool. Issue does not reproduce on tip

>gotip version
go version devel go1.20-e870de9936 Tue Dec 27 21:10:04 2022 +0000 windows/amd64

An empty file junk_arm or junk_windows is ignored as a .go file with package name as:

$GOPATH\golang\go\src\os>type junk_windows.go
package os

Testing API changes is now done using go test like:

$GOPATH\golang\go\src\cmd\api>gotip test -v -check
=== RUN   TestGolden
    api_test.go:60: skipping with -check set
--- SKIP: TestGolden (0.00s)
=== RUN   TestCompareAPI
--- PASS: TestCompareAPI (0.00s)
=== RUN   TestSkipInternal
--- PASS: TestSkipInternal (0.00s)
=== RUN   TestIssue21181
    api_test.go:216: skipping with -check set
--- SKIP: TestIssue21181 (0.05s)
=== RUN   TestIssue29837
    api_test.go:232: skipping with -check set
--- SKIP: TestIssue29837 (0.00s)
=== RUN   TestIssue41358
    api_test.go:246: skipping with -check set
--- SKIP: TestIssue41358 (0.00s)
=== RUN   TestCheck
--- PASS: TestCheck (83.63s)
PASS
ok      cmd/api 145.240s

@golang golang locked and limited conversation to collaborators Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants