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

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.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 33
  • Comments: 44 (10 by maintainers)

Commits related to this issue

Most upvoted 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.

The compiler has to be kept building with Go 1.4 for now. That means it has to keep its // +build comments. I do plan to propose bumping the bootstrap version to Go 1.17, though, for a variety of reasons, and after we’ve done that, we’d be able to remove the // +build comments.

No change in consensus, so accepted.

Change https://golang.org/cl/361480 mentions this issue: all: remove more leftover // +build lines

All the Go 1.17 prep work for //go:build lines is now landed. I’ve remilestoned the issue to track the Go 1.18 work (submitting golang.org/cl/240611).

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.