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/go: go build *.go does not account for file suffixes #16852

Closed
ghost opened this issue Aug 23, 2016 · 1 comment
Closed

cmd/go: go build *.go does not account for file suffixes #16852

ghost opened this issue Aug 23, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 23, 2016

go version go1.7 darwin/amd64

$ ls 
lib.go lib_darwin.go lib_linux.go
$ head -1 lib_darwin.go
package lib # no build tags
$ head -1 lib_linux.go
package lib # no build tags
$ go build *.go
#some error about same function defined twice
$ go build && echo $?
0
@ghost ghost changed the title cmd/go: go build *.go does not verify for file suffixes cmd/go: go build *.go does not account for file suffixes Aug 23, 2016
@ianlancetaylor
Copy link
Contributor

This is working as expected. If you explicitly list the files to build, the go tool builds exactly those files. Build constraints only apply when looking at an entire package in a directory.

@golang golang locked and limited conversation to collaborators Aug 23, 2017
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

2 participants