You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
Linux, amd64
go env Output
$ go env
What did you do?
It seems go build -tags is broken. In the following, I have three simple files, a.go, b.go, main.go
go build builds fine, go build -tags xxxdbg builds fine, but go build -tags -xxxopt fail (CHK redefined)
[ftian@localhost tmp]$ cat *.go
// +build xxxdbg
// -- this is a.go
package main
func CHK(err error) {
if err != nil {
panic(err)
}
}
// +build xxxopt
// -- this is b.go
package main
func CHK(err error) {
}
// -- this is main.go
package main
import (
"fmt"
)
func main() {
CHK(fmt.Errorf("This is an error."));
}
What did you expect to see?
go build -tags xxxdbg builds OK.
go build -tags xxxopt builds OK.
go build FAIL, CHK not defined
What did you see instead?
go build -tags xxxdbg builds OK
go build -tags xxxopt fails, CHK redeclared
go build build OK
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Linux, amd64
go env
OutputWhat did you do?
It seems go build -tags is broken. In the following, I have three simple files, a.go, b.go, main.go
go build builds fine, go build -tags xxxdbg builds fine, but go build -tags -xxxopt fail (CHK redefined)
What did you expect to see?
go build -tags xxxdbg builds OK.
go build -tags xxxopt builds OK.
go build FAIL, CHK not defined
What did you see instead?
go build -tags xxxdbg builds OK
go build -tags xxxopt fails, CHK redeclared
go build build OK
The text was updated successfully, but these errors were encountered: