Commit d52413d6 authored by Russ Cox's avatar Russ Cox

cmd/go: document that BinaryOnly packages must have accurate import info

Update BinaryOnly test by adding import _ "fmt".

Change-Id: I3a1dcfb83a27d8ff50a658060a46e1a3f481f6c7
Reviewed-on: https://go-review.googlesource.com/56276Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 13f7fe00
......@@ -917,8 +917,10 @@
// comment, indicating that the package sources are included
// for documentation only and must not be used to build the
// package binary. This enables distribution of Go packages in
// their compiled form alone. See the go/build package documentation
// for more details.
// their compiled form alone. Even binary-only packages require
// accurate import blocks listing required dependencies, so that
// those dependencies can be supplied when linking the resulting
// command.
//
//
// GOPATH environment variable
......
......@@ -3618,6 +3618,7 @@ func TestBinaryOnlyPackages(t *testing.T) {
tg.tempFile("src/p1/missing.go", `//go:binary-only-package
package p1
import _ "fmt"
func G()
`)
tg.wantNotStale("p1", "no source code", "should NOT want to rebuild p1 (first)")
......
......@@ -565,8 +565,10 @@ Non-test Go source files can also include a //go:binary-only-package
comment, indicating that the package sources are included
for documentation only and must not be used to build the
package binary. This enables distribution of Go packages in
their compiled form alone. See the go/build package documentation
for more details.
their compiled form alone. Even binary-only packages require
accurate import blocks listing required dependencies, so that
those dependencies can be supplied when linking the resulting
command.
`,
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment