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 <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Sean Liao 2025-03-21 23:06:54 +00:00 committed by Gopher Robot
parent 710476495a
commit c72e274725

View File

@ -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