Go: cmd/go: continue conversion to bug-resistant //go:build constraints

Created on 2 Sep 2020  路  15Comments  路  Source: golang/go

In June I posted a draft design for moving from // +build lines with ad-hoc syntax to //go:build lines with standard Boolean expressions; that doc also has links to a video overview and a prototype implementation.

I propose that we adopt this design, with N = 17 in the Transition section, meaning that the prep work would happen in Go 1.16, the main change would land in Go 1.17, and the transition would be finalized in Go 1.18.

Proposal Proposal-Accepted

Most helpful comment

Based on the emoji above and the lack of any objections (along with the overwhelmingly positive Reddit thread), this seems like a likely accept.

All 15 comments

Based on the emoji above and the lack of any objections (along with the overwhelmingly positive Reddit thread), this seems like a likely accept.

No change in consensus, so accepted.

Please note that accepting this means that //go:build lines will start working in _Go 1.17_, not Go 1.16.
Don't everyone rush to put them in.

Change https://golang.org/cl/240600 mentions this issue: go/build: reject //go:build without // +build

Change https://golang.org/cl/240553 mentions this issue: cmd/go: add IgnoredOtherFiles to go list; pass IgnoredFiles to vet

Change https://golang.org/cl/240601 mentions this issue: cmd/compile: reject misplaced go:build comments

Change https://golang.org/cl/240602 mentions this issue: cmd/asm: reject misplaced go:build comments

Change https://golang.org/cl/240554 mentions this issue: cmd/vet: look at ignored files in buildtag check

Change https://golang.org/cl/261958 mentions this issue: cmd: go get golang.org/x/tools@d88ec18 && go mod vendor

All the Go 1.16 prep work for //go:build lines is now landed.
I've retitled and remilestoned the issue to track the Go 1.17 work.

Change https://golang.org/cl/240604 mentions this issue: go/build/constraint: add parser for build tag constraint expressions

Change https://golang.org/cl/240609 mentions this issue: cmd/vet: update buildtag check for //go:build lines

Change https://golang.org/cl/240608 mentions this issue: go/printer: canonicalize //go:build and // +build lines while formatting

Change https://golang.org/cl/240607 mentions this issue: go/build: prefer //go:build over // +build lines

Was this page helpful?
0 / 5 - 0 ratings