]> Cypherpunks repositories - gostls13.git/commit
go/build: prefer //go:build over // +build lines
authorRuss Cox <rsc@golang.org>
Mon, 22 Jun 2020 17:27:10 +0000 (13:27 -0400)
committerRuss Cox <rsc@golang.org>
Sat, 20 Feb 2021 03:54:43 +0000 (03:54 +0000)
commit5b76343a1040571e3d2249168a00a4dc814e920a
tree6bea5c8a8b8fd1888586c4cd2d2dd035ff03d74c
parenta8942d2cffd80c68febe1c908a0eb464d2f5bb40
go/build: prefer //go:build over // +build lines

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

- Reject files with multiple //go:build lines.
- If a file has both //go:build and // +build lines, only use the //go:build line.
- Otherwise fall back to // +build lines
- Use go/build/constraint for parsing both //go:build and // +build lines.

For Go 1.17.

Change-Id: I32e2404d8ce266230f767718dc7cc24e77b425e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/240607
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/go/build/build.go
src/go/build/build_test.go
src/go/build/deps_test.go