in build tag, && prec is 1, but || is 2. is that right?

149 views
Skip to first unread message

xie cui

unread,
May 4, 2026, 8:15:02 AM (8 days ago) May 4
to golang-dev

Alan Donovan

unread,
May 4, 2026, 9:35:34 AM (8 days ago) May 4
to xie cui, golang-dev
That is suspicious. Given that ! has precedence 3 (high, presumably), the relative order of && (multiply) and || (add) looks wrong. Could you file an issue? (And if you can exhibit the problem with a test case, so much the better.)


--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-dev/b9ec2876-9364-417f-9966-5c00aa51f24cn%40googlegroups.com.

Dmitri Shuralyov

unread,
May 4, 2026, 12:07:39 PM (8 days ago) May 4
to golang-dev
Thanks for pointing this out. In general, for a suspected logic bug in a specific place like this, you could file an issue right away.

We have a //go:build constraint parser in the go/build/package and thanks to proposal 54265, by now it should be possible to use it directly. (In fact, I think even proposal 44505 was enough since that package was added in Go 1.16.) Then cmd/dist doesn't need to maintain its copy, and this bug gets fixed by deleting code. Sent go.dev/cl/773823.

Reply all
Reply to author
Forward
0 new messages