proposal: cmd/go: support bracketed expressions for build constraints #36279
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
FrozenDueToAge
Proposal
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
do not know
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
write a build contstraint that is not to
// +build linux,!cgo darwin,!cgo
What did you expect to write?
add bracket simple
// +build !(linux,!cgo darwin,!cgo)
or
using golang syntax
// +build !((linux && (!cgo)) || (darwin && (!cgo)))
or
the boolean formula in https://golang.org/pkg/go/build/#hdr-Build_Constraints
// +build (NOT ((linux AND (NOT cgo)) OR (darwin AND (NOT cgo))))
What did you write instead?
I have read the document of https://golang.org/pkg/go/build/#hdr-Build_Constraints
Then I do some boolean algebra from https://en.wikipedia.org/wiki/Boolean_algebra#Laws
Then I get the working code.
I think the golang should support bracket in this place.
The text was updated successfully, but these errors were encountered: