]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: document import path checking
authorShenghou Ma <minux@golang.org>
Thu, 8 Jan 2015 10:13:28 +0000 (05:13 -0500)
committerMinux Ma <minux@golang.org>
Thu, 8 Jan 2015 23:24:59 +0000 (23:24 +0000)
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>
src/cmd/go/doc.go
src/cmd/go/help.go
src/cmd/go/mkdoc.sh

index 65640fb483bcbef4940e1bff575fb77382ca2188..d0d8a8a5b2e8d298b544e295360ebf7923ab1658 100644 (file)
@@ -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
index 201f0e2d79e2afa357888d61748b9c37d119d633..c590fdb37fe80665050428af053040b8fd56a62c 100644 (file)
@@ -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.
        `,
 }
 
index 12fd7ba3e7f62e4fc874cb1581be9d332767a60b..e15e8809ce331b7c9c01c3413bcbb8d4720bc6f1 100755 (executable)
@@ -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