aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-07-02 11:40:14 -0400
committerRuss Cox <rsc@golang.org>2020-07-02 15:41:23 +0000
commit15eab3e4dca5200e2f3c0fd81bc6ac097091b94e (patch)
tree779c314571e46664da7a46365157038286a1f24d
parentf36a4cbf9e6dd88a10c69e32f719c2eb5b86d9ca (diff)
downloadgo-x-proposal-15eab3e4dca5200e2f3c0fd81bc6ac097091b94e.tar.xz
design/draft-gobuild: flag //go:build-only files in Go 1.N go vet
Suggested by thepudds. Thanks! Change-Id: I4b45a04f04989ca28937deaddfea50a3e5514e4b Reviewed-on: https://go-review.googlesource.com/c/proposal/+/240837 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-rw-r--r--design/draft-gobuild.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/design/draft-gobuild.md b/design/draft-gobuild.md
index e1b2e09..03c6d63 100644
--- a/design/draft-gobuild.md
+++ b/design/draft-gobuild.md
@@ -409,6 +409,12 @@ At this point:
It will fail when a Go source file contains
`//go:build` and `// +build` lines with different meanings.
If the check fails, one can run `gofmt` `-w`.
+ - The `buildtags` check will also fail when a Go source file contains
+ `//go:build` without `// +build` and its containing module
+ has a `go` line listing a version before Go 1.N.
+ If the check fails, one can add any `// +build` line and then run `gofmt` `-w`,
+ which will replace it with the correct ones.
+ Or one can bump the `go.mod` go version to Go 1.N.
- Release notes will explain `//go:build` and the transition.
At this point: