From b5fcb35b3197bc4d444ee0b9ad4ae6c5998864cf Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 19 Sep 2022 17:57:44 +0200 Subject: [PATCH] cmd/cgo: mention //go:build line in godoc Say "//go:build" instead of "// +build" in the package level godoc comment. Change-Id: I4700227a03197ffbe29e4de04d068b4c63bb5bf0 Reviewed-on: https://go-review.googlesource.com/c/go/+/431856 Auto-Submit: Tobias Klauser Reviewed-by: Cherry Mui Run-TryBot: Tobias Klauser Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor --- src/cmd/cgo/doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index 7fb6179e26..366844d150 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -125,7 +125,7 @@ environment variable when running the go tool: set it to 1 to enable the use of cgo, and to 0 to disable it. The go tool will set the build constraint "cgo" if cgo is enabled. The special import "C" implies the "cgo" build constraint, as though the file also said -"// +build cgo". Therefore, if cgo is disabled, files that import +"//go:build cgo". Therefore, if cgo is disabled, files that import "C" will not be built by the go tool. (For more about build constraints see https://golang.org/pkg/go/build/#hdr-Build_Constraints). -- 2.50.0