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

go/build: Go test not including file named darwin.go #10351

Closed
darraghjones opened this issue Apr 5, 2015 · 3 comments
Closed

go/build: Go test not including file named darwin.go #10351

darraghjones opened this issue Apr 5, 2015 · 3 comments

Comments

@darraghjones
Copy link

c:\Users\darragh\Documents\gocode\src\robbie>go version
go version go1.3.3 windows/amd64

When I run go test, it's complaining about Darwin being undefined:

c:\Users\darragh\Documents\gocode\src\robbie>go test
# robbie
.\robbie_test.go:60: undefined: Darwin
FAIL    robbie [build failed]

However it is defined in a file named darwin.go
If I rename darwin.go to d.go (or anything else) it works:

c:\Users\darragh\Documents\gocode\src\robbie>ren darwin.go d.go

c:\Users\darragh\Documents\gocode\src\robbie>go test
0xc082000430
PASS
ok      robbie  0.030s
@dominikh
Copy link
Member

dominikh commented Apr 5, 2015

Update to Go 1.4 or later. Before Go 1.4, "darwin.go" would be treated identically to "foo_darwin.go", which is a build constraint on darwin, as described in http://golang.org/pkg/go/build/

@minux
Copy link
Member

minux commented Apr 5, 2015

Yeah, there is behavior change in Go 1.4.

See http://golang.org/doc/go1.4#filenames

@minux minux closed this as completed Apr 5, 2015
@darraghjones
Copy link
Author

Thanks for the info.

@mikioh mikioh changed the title Go test not including file named darwin.go go/build: Go test not including file named darwin.go Apr 6, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
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

4 participants