Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

incorrect-looking // +build line #97

Closed
rsc opened this issue Mar 31, 2020 · 2 comments
Closed

incorrect-looking // +build line #97

rsc opened this issue Mar 31, 2020 · 2 comments

Comments

@rsc
Copy link

rsc commented Mar 31, 2020

I've been analyzing // +build usage in the Go ecosystem and turned up monotime/monotime_linux_generic.go, which says:

// +build linux,!amd64
// +build linux,amd64,noasm
// +build !go1.9

This means "(linux && !amd64) && (linux && amd64 && noasm) && !go1.9",
which is unsatisfiable since !amd64 and amd64 cannot both be true.

From context it looks like the intent was to OR those three lines together, which would be:

// +build linux,!amd64 linux,amd64,noasm !go1.9

Best,
Russ

@muesli
Copy link
Contributor

muesli commented Apr 1, 2020

I agree, that definitely looks fishy. Thanks for the heads up @rsc!

We should also check the build tags of the other implementations, since we obviously can only have one of them active at a time.

@david415
Copy link
Member

david415 commented Apr 4, 2020

@rsc thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants