]> Cypherpunks repositories - gostls13.git/commit
cmd/go: update for //go:build lines
authorRuss Cox <rsc@golang.org>
Thu, 28 Oct 2021 02:59:55 +0000 (22:59 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 28 Oct 2021 18:10:59 +0000 (18:10 +0000)
commited475fe53ba41c0c15b11565f8b9d00165345bc2
treef68ace798286d83ef87ac8befc00fa0aad5d3293
parent2bc8ed8e9c5d8ae303b42bbd8c65f2c5dc38352a
cmd/go: update for //go:build lines

cmd/go has its own //go:build evaluator, which is needed for
patterns like 'all'. The code is a modified copy of some unexported
routines from the go/build package. Update it by copying those
again and re-modifying them. The modifications are primarily the new
func eval and also ignoring errors.

This CL will need to be backported to Go 1.17, or else Go 1.17
will break when faced with certain //go:build-only repos during
'go list all' or 'go mod tidy'.

For #41184.
Fixes #49198.

Change-Id: Ie0fe3caa8d49004935ecd76d7977f767fe50e317
Reviewed-on: https://go-review.googlesource.com/c/go/+/359355
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/go/internal/imports/build.go
src/cmd/go/testdata/script/list_all_gobuild.txt [new file with mode: 0644]