From c72e2747255b6ee44d024732b37333dbc9efa37e Mon Sep 17 00:00:00 2001 From: Sean Liao Date: Fri, 21 Mar 2025 23:06:54 +0000 Subject: [PATCH] go/build: prioritize build constraints in docs Now that modules is the primary way of building go code, GOPATH shouldn't be the first topic. Change-Id: Icaf6c651bdcfbe69068c5980845f8eb5e40ead99 Reviewed-on: https://go-review.googlesource.com/c/go/+/660135 Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Reviewed-by: Ian Lance Taylor --- src/go/build/doc.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/go/build/doc.go b/src/go/build/doc.go index da11e49f63..573631de6a 100644 --- a/src/go/build/doc.go +++ b/src/go/build/doc.go @@ -4,6 +4,21 @@ // Package build gathers information about Go packages. // +// # Build Constraints +// +// A build constraint, also known as a build tag, is a condition under which a +// file should be included in the package. Build constraints are given by a +// line comment that begins +// +// //go:build +// +// Build constraints may also be part of a file's name +// (for example, source_windows.go will only be included if the target +// operating system is windows). +// +// See 'go help buildconstraint' +// (https://pkg.go.dev/cmd/go#hdr-Build_constraints) for details. +// // # Go Path // // The Go path is a list of directory trees containing Go source code. @@ -55,21 +70,6 @@ // foo/ // bar.a (installed package object) // -// # Build Constraints -// -// A build constraint, also known as a build tag, is a condition under which a -// file should be included in the package. Build constraints are given by a -// line comment that begins -// -// //go:build -// -// Build constraints may also be part of a file's name -// (for example, source_windows.go will only be included if the target -// operating system is windows). -// -// See 'go help buildconstraint' -// (https://golang.org/cmd/go/#hdr-Build_constraints) for details. -// // # Binary-Only Packages // // In Go 1.12 and earlier, it was possible to distribute packages in binary