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
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))))
smasher164
changed the title
cmd/go: support bracketed expressions for build constraints
proposal: cmd/go: support bracketed expressions for build constraints
Dec 25, 2019
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: