mirror of
https://github.com/golang/go
synced 2024-11-19 02:04:42 -07:00
cmd/go: document import path checking
This is a replay of CL 189760043 that is in release-branch.go1.4, but not in master branch somehow. Change-Id: I11eb40a24273e7be397e092ef040e54efb8ffe86 Reviewed-on: https://go-review.googlesource.com/2541 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
7b2524217e
commit
5664eda733
@ -875,7 +875,26 @@ listed in the GOPATH environment variable (see 'go help gopath').
|
||||
|
||||
The go command attempts to download the version of the
|
||||
package appropriate for the Go release being used.
|
||||
Run 'go help install' for more.
|
||||
Run 'go help get' for more.
|
||||
|
||||
Import path checking
|
||||
|
||||
When the custom import path feature described above redirects to a
|
||||
known code hosting site, each of the resulting packages has two possible
|
||||
import paths, using the custom domain or the known hosting site.
|
||||
|
||||
A package statement is said to have an "import comment" if it is immediately
|
||||
followed (before the next newline) by a comment of one of these two forms:
|
||||
|
||||
package math // import "path"
|
||||
package math /* import "path" * /
|
||||
|
||||
The go command will refuse to install a package with an import comment
|
||||
unless it is being referred to by that import path. In this way, import comments
|
||||
let package authors make sure the custom import path is used and not a
|
||||
direct path to the underlying code hosting site.
|
||||
|
||||
See https://golang.org/s/go14customimport for details.
|
||||
|
||||
|
||||
Description of package lists
|
||||
|
@ -235,7 +235,26 @@ listed in the GOPATH environment variable (see 'go help gopath').
|
||||
|
||||
The go command attempts to download the version of the
|
||||
package appropriate for the Go release being used.
|
||||
Run 'go help install' for more.
|
||||
Run 'go help get' for more.
|
||||
|
||||
Import path checking
|
||||
|
||||
When the custom import path feature described above redirects to a
|
||||
known code hosting site, each of the resulting packages has two possible
|
||||
import paths, using the custom domain or the known hosting site.
|
||||
|
||||
A package statement is said to have an "import comment" if it is immediately
|
||||
followed (before the next newline) by a comment of one of these two forms:
|
||||
|
||||
package math // import "path"
|
||||
package math /* import "path" */
|
||||
|
||||
The go command will refuse to install a package with an import comment
|
||||
unless it is being referred to by that import path. In this way, import comments
|
||||
let package authors make sure the custom import path is used and not a
|
||||
direct path to the underlying code hosting site.
|
||||
|
||||
See https://golang.org/s/go14customimport for details.
|
||||
`,
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,6 @@
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
go install # So the next line will produce updated documentation.
|
||||
go help documentation > doc.go
|
||||
go help documentation | sed 's; \*/; * /;' >doc.go
|
||||
gofmt -w doc.go
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user