From: Tobias Klauser Date: Mon, 19 Sep 2022 15:57:44 +0000 (+0200) Subject: cmd/cgo: mention //go:build line in godoc X-Git-Tag: go1.20rc1~977 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b5fcb35b3197bc4d444ee0b9ad4ae6c5998864cf;p=gostls13.git 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 --- 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).