After your initial reply and carefully re-reading I also agree that's what
it means. It is however, IMHO, not clear on first reading and there is an
implication by omission that "unix" could be considered a valid "GOOS"
value. Now I know, I know. The next first-time reader, perhaps not so much.
During a particular build, the following build tags are satisfied:
- ...
- "unix", if GOOS is a Unix or Unix-like system.
- ...
It then says:
If a file's name, after stripping the extension and a possible _test
suffix, matches any of the following patterns:
*_GOOS *_GOARCH *_GOOS_GO
Ah! Got it. Thanks.
Would it perhaps be good to mention this in the docs,
here: https://pkg.go.dev/cmd/go#hdr-Build_constraints ?
The bullet points refer to "unix" (which is true) and then a naïve reader,
like me, would think the later paragraphs about GOOS also apply.
Peter
On Thursday, 31
https://github.com/golang/go/issues/51572
On Thursday, 31 August 2023 at 08:57:15 UTC+1 Peter Galbavy wrote:
> I have used comment level build constraints for a while but I moved to
> using _linux.go and _windows.go over time as it makes it clearer for
> external viewing.
>
> A user reported th