From e0eb9be77e9e409479ef48a65f750546d2a9ddcc Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Sat, 25 Mar 2023 15:58:06 -0700 Subject: [PATCH] cmd/go: change +build doc references to //go:build This changes a few references to `+build` into the modern `//go:build`. It was compiled by editing `cmd/go/internal/list/context.go`, running `go test cmd/go -v -run=TestDocsUpToDate -fixdocs`, and then editing list.go and build.go by hand. --- src/cmd/go/alldocs.go | 4 ++-- src/cmd/go/internal/list/context.go | 2 +- src/cmd/go/internal/list/list.go | 4 ++-- src/cmd/go/internal/modindex/build.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index d6701dcfffd..99a4f75ab5a 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -883,9 +883,9 @@ // GOROOT string // Go root // GOPATH string // Go path // CgoEnabled bool // whether cgo can be used -// UseAllFiles bool // use files regardless of +build lines, file names +// UseAllFiles bool // use files regardless of //go:build lines, file names // Compiler string // compiler to assume when computing target paths -// BuildTags []string // build constraints to match in +build lines +// BuildTags []string // build constraints to match in //go:build lines // ToolTags []string // toolchain-specific build constraints // ReleaseTags []string // releases the current release is compatible with // InstallSuffix string // suffix to use in the name of the install dir diff --git a/src/cmd/go/internal/list/context.go b/src/cmd/go/internal/list/context.go index 2dc63766b70..9d6494cfba0 100644 --- a/src/cmd/go/internal/list/context.go +++ b/src/cmd/go/internal/list/context.go @@ -14,7 +14,7 @@ type Context struct { GOROOT string `json:",omitempty"` // Go root GOPATH string `json:",omitempty"` // Go path CgoEnabled bool `json:",omitempty"` // whether cgo can be used - UseAllFiles bool `json:",omitempty"` // use files regardless of +build lines, file names + UseAllFiles bool `json:",omitempty"` // use files regardless of //go:build lines, file names Compiler string `json:",omitempty"` // compiler to assume when computing target paths BuildTags []string `json:",omitempty"` // build constraints to match in +build lines ToolTags []string `json:",omitempty"` // toolchain-specific build constraints diff --git a/src/cmd/go/internal/list/list.go b/src/cmd/go/internal/list/list.go index 6d6deda8846..31c14c86c6a 100644 --- a/src/cmd/go/internal/list/list.go +++ b/src/cmd/go/internal/list/list.go @@ -148,9 +148,9 @@ The template function "context" returns the build context, defined as: GOROOT string // Go root GOPATH string // Go path CgoEnabled bool // whether cgo can be used - UseAllFiles bool // use files regardless of +build lines, file names + UseAllFiles bool // use files regardless of //go:build lines, file names Compiler string // compiler to assume when computing target paths - BuildTags []string // build constraints to match in +build lines + BuildTags []string // build constraints to match in //go:build lines ToolTags []string // toolchain-specific build constraints ReleaseTags []string // releases the current release is compatible with InstallSuffix string // suffix to use in the name of the install dir diff --git a/src/cmd/go/internal/modindex/build.go b/src/cmd/go/internal/modindex/build.go index ae03d4a7798..b57f2f6368f 100644 --- a/src/cmd/go/internal/modindex/build.go +++ b/src/cmd/go/internal/modindex/build.go @@ -42,7 +42,7 @@ type Context struct { Dir string CgoEnabled bool // whether cgo files are included - UseAllFiles bool // use files regardless of +build lines, file names + UseAllFiles bool // use files regardless of //go:build lines, file names Compiler string // compiler to assume when computing target paths // The build, tool, and release tags specify build constraints