]> Cypherpunks repositories - gostls13.git/commit
cmd/fix: add buildtag fix
authorRuss Cox <rsc@golang.org>
Mon, 29 Jun 2020 18:29:09 +0000 (14:29 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 28 Oct 2021 17:52:59 +0000 (17:52 +0000)
commit31249688487ca3a60f856ad082d4e84c4d5f79fb
tree69b3eb3308e882329c2d780e784ee4f01888f65a
parent6bd0e7fa8a2cb5c8de9d4566c900233715d8cf0e
cmd/fix: add buildtag fix

Now that Go 1.17 is out and Go 1.15 is unsupported,
removing // +build lines can be done safely: in the worst case,
if code is compiled using Go 1.16 the toolchain will detect
the presence of a //go:build without // +build and fail the build.
(It will not silently choose the wrong files.)

Note that +build lines will continue to work in Go sources forever.
This just provides a mechanism for users who are done with
Go 1.16 to remove them easily, by running "go fix".

Also update for new generics AST.

For #41184.
Fixes #48978.

Change-Id: I11a432c319e5abd05ad68dda9ccd7a7fdcc8bbb8
Reviewed-on: https://go-review.googlesource.com/c/go/+/240611
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/fix/buildtag.go [new file with mode: 0644]
src/cmd/fix/buildtag_test.go [new file with mode: 0644]
src/cmd/fix/fix.go
src/cmd/fix/main.go
src/cmd/fix/main_test.go
src/cmd/go/alldocs.go
src/cmd/go/internal/fix/fix.go