From 53c088fbf05f42b24e1f7aa40889ca51055f9f29 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 19 Aug 2019 13:17:34 -0400 Subject: [PATCH] cmd/go: fix "go help build -o" docs The docs refer to "the last two paragraphs", but in fact should refer to the first two of the previous three paragraphs. Moved up the out of place paragraph. Updates #14295 Change-Id: I066da7a665bc6754d246782b941af214a385017a Reviewed-on: https://go-review.googlesource.com/c/go/+/190839 Reviewed-by: Bryan C. Mills Reviewed-by: Dmitri Shuralyov Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/cmd/go/alldocs.go | 4 ++-- src/cmd/go/internal/work/build.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index f15ff16abe..63ec2321be 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -78,6 +78,8 @@ // If the arguments to build are a list of .go files from a single directory, // build treats them as a list of source files specifying a single package. // +// When compiling packages, build ignores files that end in '_test.go'. +// // When compiling a single main package, build writes // the resulting executable to an output file named after // the first source file ('go build ed.go rx.go' writes 'ed' or 'ed.exe') @@ -88,8 +90,6 @@ // build compiles the packages but discards the resulting object, // serving only as a check that the packages can be built. // -// When compiling packages, build ignores files that end in '_test.go'. -// // The -o flag forces build to write the resulting executable or object // to the named output file or directory, instead of the default behavior described // in the last two paragraphs. If the named output is a directory that exists, diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go index ed5a149da3..9305b2d859 100644 --- a/src/cmd/go/internal/work/build.go +++ b/src/cmd/go/internal/work/build.go @@ -30,6 +30,8 @@ along with their dependencies, but it does not install the results. If the arguments to build are a list of .go files from a single directory, build treats them as a list of source files specifying a single package. +When compiling packages, build ignores files that end in '_test.go'. + When compiling a single main package, build writes the resulting executable to an output file named after the first source file ('go build ed.go rx.go' writes 'ed' or 'ed.exe') @@ -40,8 +42,6 @@ When compiling multiple packages or a single non-main package, build compiles the packages but discards the resulting object, serving only as a check that the packages can be built. -When compiling packages, build ignores files that end in '_test.go'. - The -o flag forces build to write the resulting executable or object to the named output file or directory, instead of the default behavior described in the last two paragraphs. If the named output is a directory that exists, -- 2.50.0