[go] cmd/go: document $GOPROXY, other module adjustments

279 views
Skip to first unread message

Russ Cox (Gerrit)

unread,
Jul 18, 2018, 3:21:01 PM7/18/18
to Bryan C. Mills, Ian Lance Taylor, goph...@pubsubhelper.golang.org, Russ Cox, golang-co...@googlegroups.com

Russ Cox would like Bryan C. Mills to review this change.

View Change

cmd/go: document $GOPROXY, other module adjustments

Also document module use of GOPATH including GOPATH/src/mod
and GOPATH/bin (unless GOBIN is set).

Fixes #26399.
Fixes #26406.

Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
---
M src/cmd/go/internal/help/helpdoc.go
M src/cmd/go/internal/modfetch/proxy.go
M src/cmd/go/internal/modload/help.go
3 files changed, 116 insertions(+), 9 deletions(-)

diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go
index a5cfffd..2e01541 100644
--- a/src/cmd/go/internal/help/helpdoc.go
+++ b/src/cmd/go/internal/help/helpdoc.go
@@ -195,6 +195,7 @@
that repository. The supported version control systems are:

Bazaar .bzr
+ Fossil .fossil
Git .git
Mercurial .hg
Subversion .svn
@@ -238,7 +239,7 @@
In particular, it should appear before any raw JavaScript or CSS,
to avoid confusing the go command's restricted parser.

-The vcs is one of "git", "hg", "svn", etc,
+The vcs is one of "bzr", "fossil", "git", "hg", "svn".

The repo-root is the root of the version control system
containing a scheme and not containing a .vcs qualifier.
@@ -260,12 +261,22 @@
same meta tag and then git clone https://code.org/r/p/exproj into
GOPATH/src/example.org.

-New downloaded packages are written to the first directory listed in the GOPATH
-environment variable (For more details see: 'go help gopath').
+When using GOPATH, downloaded packages are written to the first directory
+listed in the GOPATH environment variable.
+(See 'go help gopath-get' and 'go help gopath'.)

-The go command attempts to download the version of the
-package appropriate for the Go release being used.
-Run 'go help get' for more.
+When using modules, downloaded packages are stored in the module cache
+(see 'go help modules-get' and 'go help goproxy'.)
+
+When using modules, an additional variant of the go-import meta tag is
+recognized and is preferred over those listing version control systems.
+That variant uses "mod" as the vcs in the content value, as in:
+
+ <meta name="go-import" content="example.org mod https://code.org/moduleproxy">
+
+This tag means to fetch modules with paths beginning with example.org
+from the module proxy available at the URL https://code.org/moduleproxy.
+See 'go help goproxy' for details about the proxy protocol.

Import path checking

@@ -288,6 +299,9 @@
This makes it possible to copy code into alternate locations in vendor trees
without needing to update import comments.

+Import path checking is also disabled when using modules.
+They are obsoleted by the go.mod file's module statement.
+
See https://golang.org/s/go14customimport for details.
`,
}
@@ -360,6 +374,12 @@

See https://golang.org/doc/code.html for an example.

+GOPATH and Modules
+
+When using modules, GOPATH is no longer used when resolving imports.
+However, it is still used to store downloaded source code,
+in GOPATH/src/mod, and compiled commands, in GOPATH/bin.
+
Internal Directories

Code in or below a directory named "internal" is importable only
@@ -471,6 +491,8 @@
Examples are linux, darwin, windows, netbsd.
GOPATH
For more details see: 'go help gopath'.
+ GOPROXY
+ URL of Go module proxy. See 'go help goproxy'.
GORACE
Options for the race detector.
See https://golang.org/doc/articles/race_detector.html.
diff --git a/src/cmd/go/internal/modfetch/proxy.go b/src/cmd/go/internal/modfetch/proxy.go
index 4cc7457..4c16b90 100644
--- a/src/cmd/go/internal/modfetch/proxy.go
+++ b/src/cmd/go/internal/modfetch/proxy.go
@@ -19,13 +19,78 @@
"cmd/go/internal/semver"
)

+var HelpGoproxy = &base.Command{
+ UsageLine: "goproxy",
+ Short: "module proxy protocol",
+ Long: `
+The go command defaults to downloading modules from version control systems
+directly, just as 'go get' always has. If the GOPROXY environment variable
+is set to the URL of a module proxy, the go command will instead fetch
+all modules from that proxy. No matter the source of the modules, downloaded
+modules must match existing entries in go.sum (see 'go help modules' for
+discussion of verification).
+
+A Go module proxy is any web server that can respond to GET requests for
+URLs of a specified form. The requests have no query parameters, so even
+a site serving from a fixed file system (including a file:/// URL)
+can be a module proxy.
+
+The GET requests sent to a Go module proxy are:
+
+GET $GOPROXY/<module>/@v/list returns a list of all known versions of the
+given module, one per line.
+
+GET $GOPROXY/<module>/@v/<version>.info returns JSON-formatted metadata
+about that version of the given module.
+
+GET $GOPROXY/<module>/@v/<version>.mod returns the go.mod file
+for that version of the given module.
+
+GET $GOPROXY/<module>/@v/<version>.zip returns the zip archive
+for that version of the given module.
+
+To avoid problems when serving from case-sensitive file systems,
+the <module> and <version> elements are case-encoded, replacing every
+uppercase letter with an exclamation mark followed by the correponding
+lower-case letter: github.com/Azure encodes as github.com/!azure.
+
+The JSON-formatted metadata about a given module corresponds to
+this Go data structure, which may be expanded in the future:
+
+ type Info struct {
+ Version string // version string
+ Time time.Time // commit time
+ }
+
+The zip archive for a specific version of a given module is a
+standard zip file that contains the file tree corresponding
+to the module's source code and related files. The archive uses
+slash-separated paths, and every file path in the archive must
+begin with <module>@<version>/, where the module and version are
+substituted directly, not case-encoded. The root of the module
+file tree corresponds to the <module>@<version>/ prefix in the
+archive.
+
+Even when downloading directly from version control systems,
+the go command synthesizes explicit info, mod, and zip files
+and stores them in its local cache, $GOPATH/src/mod/cache/download,
+the same as if it had downloaded them directly from a proxy.
+The cache layout is the same as the proxy URL space, so
+serving $GOPATH/src/mod/cache/download at (or copying it to)
+https://example.com/proxy would let other users access those
+cached module versions with GOPROXY=https://example.com/proxy.
+`
+
var proxyURL = os.Getenv("GOPROXY")

func lookupProxy(path string) (Repo, error) {
+ if strings.Contains(proxyURL, ",") {
+ return nil, fmt.Errorf("invalid $GOPROXY setting: cannot have comma")
+ }
u, err := url.Parse(proxyURL)
if err != nil || u.Scheme != "http" && u.Scheme != "https" && u.Scheme != "file" {
// Don't echo $GOPROXY back in case it has user:password in it (sigh).
- return nil, fmt.Errorf("invalid $GOPROXY setting")
+ return nil, fmt.Errorf("invalid $GOPROXY setting: malformed URL or invalid scheme (must be http, https, file)")
}
return newProxyRepo(u.String(), path)
}
diff --git a/src/cmd/go/internal/modload/help.go b/src/cmd/go/internal/modload/help.go
index b457433..5c51bd3 100644
--- a/src/cmd/go/internal/modload/help.go
+++ b/src/cmd/go/internal/modload/help.go
@@ -49,6 +49,12 @@
GOPATH/src and itself contains a go.mod file or is below a directory
containing a go.mod file.

+In module-aware mode, GOPATH is no longer used as the mechanism
+for resolving the meaning of imports during a build, but it is still used
+for holding downloaded dependencies (in GOPATH/src/mod) and
+for storing installed commands (in GOPATH/bin, when GOBIN is unset;
+see 'go help environment').
+
Defining a module

A module is defined by a tree of Go source files with a go.mod file
@@ -233,7 +239,6 @@
go get github.com/gorilla/mux@c856192 # records v0.0.0-20180517173623-c85619274f5d
go get github.com/gorilla/mux@master # records current meaning of master

-
Module compatibility and semantic versioning

The go command requires that modules use semantic versions and expects that
@@ -286,7 +291,15 @@
See https://research.swtch.com/vgo-import and https://semver.org/
for more information.

-Module verification
+Module code layout
+
+For now, see https://research.swtch.com/vgo-module for information
+about how source code in version control systems is mapped to
+module file trees.
+
+TODO: Add documentation to go command.
+
+Module downloading and verification

The go command maintains, in the main module's root directory alongside
go.mod, a file named go.sum containing the expected cryptographic checksums
@@ -302,6 +315,13 @@
the cached copies of module downloads still match both their recorded
checksums and the entries in go.sum.

+The go command can fetch modules from a proxy instead of connecting
+to source control systems directly, according to the setting of the GOPROXY
+environment variable.
+
+See 'go help goproxy' for details about the proxy and also the format of
+the cached downloaded packages.
+
Modules and vendoring

When using modules, the go command completely ignores vendor directories.

To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
Gerrit-Change-Number: 124707
Gerrit-PatchSet: 1
Gerrit-Owner: Russ Cox <r...@golang.org>
Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-MessageType: newchange

Gobot Gobot (Gerrit)

unread,
Jul 18, 2018, 3:21:12 PM7/18/18
to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

TryBots beginning. Status page: https://farmer.golang.org/try?commit=9229bb92

View Change

    To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
    Gerrit-Change-Number: 124707
    Gerrit-PatchSet: 1
    Gerrit-Owner: Russ Cox <r...@golang.org>
    Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-CC: Gobot Gobot <go...@golang.org>
    Gerrit-Comment-Date: Wed, 18 Jul 2018 19:21:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Gobot Gobot (Gerrit)

    unread,
    Jul 18, 2018, 3:22:38 PM7/18/18
    to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

    Build is still in progress...
    This change failed on linux-386:
    See https://storage.googleapis.com/go-build-log/9229bb92/linux-386_a409ddea.log

    Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report.

    View Change

      To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
      Gerrit-Change-Number: 124707
      Gerrit-PatchSet: 1
      Gerrit-Owner: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-CC: Gobot Gobot <go...@golang.org>
      Gerrit-Comment-Date: Wed, 18 Jul 2018 19:22:36 +0000

      Gobot Gobot (Gerrit)

      unread,
      Jul 18, 2018, 3:36:50 PM7/18/18
      to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

      19 of 19 TryBots failed:
      Failed on linux-386: https://storage.googleapis.com/go-build-log/9229bb92/linux-386_a409ddea.log
      Failed on misc-compile-openbsd: https://storage.googleapis.com/go-build-log/9229bb92/misc-compile-openbsd_cf048b17.log
      Failed on misc-compile-plan9: https://storage.googleapis.com/go-build-log/9229bb92/misc-compile-plan9_911e1deb.log
      Failed on misc-compile-nacl: https://storage.googleapis.com/go-build-log/9229bb92/misc-compile-nacl_006c0873.log
      Failed on misc-compile-mips: https://storage.googleapis.com/go-build-log/9229bb92/misc-compile-mips_88f1b439.log
      Failed on misc-compile-freebsd: https://storage.googleapis.com/go-build-log/9229bb92/misc-compile-freebsd_9d829d7f.log
      Failed on misc-compile-ppc: https://storage.googleapis.com/go-build-log/9229bb92/misc-compile-ppc_8fbcdc4c.log
      Failed on misc-compile: https://storage.googleapis.com/go-build-log/9229bb92/misc-compile_f4b063f9.log
      Failed on misc-compile-netbsd: https://storage.googleapis.com/go-build-log/9229bb92/misc-compile-netbsd_3d4e2094.log
      Failed on nacl-386: https://storage.googleapis.com/go-build-log/9229bb92/nacl-386_2ae8d07b.log
      Failed on openbsd-amd64-62: https://storage.googleapis.com/go-build-log/9229bb92/openbsd-amd64-62_9de30e31.log
      Failed on js-wasm: https://storage.googleapis.com/go-build-log/9229bb92/js-wasm_1744987e.log
      Failed on misc-vet-vetall: https://storage.googleapis.com/go-build-log/9229bb92/misc-vet-vetall_a16372a0.log
      Failed on linux-amd64-race: https://storage.googleapis.com/go-build-log/9229bb92/linux-amd64-race_66e89672.log
      Failed on windows-amd64-2016: https://storage.googleapis.com/go-build-log/9229bb92/windows-amd64-2016_d82e5d42.log
      Failed on nacl-amd64p32: https://storage.googleapis.com/go-build-log/9229bb92/nacl-amd64p32_ca37a0b7.log
      Failed on freebsd-amd64-11_1: https://storage.googleapis.com/go-build-log/9229bb92/freebsd-amd64-11_1_ca8baddf.log
      Failed on windows-386-2008: https://storage.googleapis.com/go-build-log/9229bb92/windows-386-2008_3c35ad5a.log
      Failed on linux-amd64: https://storage.googleapis.com/go-build-log/9229bb92/linux-amd64_085b59e6.log

      Consult https://build.golang.org/ to see whether they are new failures.

      Patch set 1:TryBot-Result -1

      View Change

        To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
        Gerrit-Change-Number: 124707
        Gerrit-PatchSet: 1
        Gerrit-Owner: Russ Cox <r...@golang.org>
        Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
        Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
        Gerrit-Reviewer: Russ Cox <r...@golang.org>
        Gerrit-Comment-Date: Wed, 18 Jul 2018 19:36:49 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        Gerrit-MessageType: comment

        Russ Cox (Gerrit)

        unread,
        Jul 19, 2018, 10:04:12 AM7/19/18
        to Russ Cox, goph...@pubsubhelper.golang.org, Gobot Gobot, Bryan C. Mills, golang-co...@googlegroups.com

        Uploaded patch set 2: Patch Set 1 was rebased.

        View Change

          To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
          Gerrit-Change-Number: 124707
          Gerrit-PatchSet: 2
          Gerrit-Owner: Russ Cox <r...@golang.org>
          Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
          Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
          Gerrit-Reviewer: Russ Cox <r...@golang.org>
          Gerrit-Comment-Date: Thu, 19 Jul 2018 14:04:07 +0000

          Gobot Gobot (Gerrit)

          unread,
          Jul 19, 2018, 10:04:22 AM7/19/18
          to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

          TryBots beginning. Status page: https://farmer.golang.org/try?commit=4aea304f

          View Change

            To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
            Gerrit-Change-Number: 124707
            Gerrit-PatchSet: 2
            Gerrit-Owner: Russ Cox <r...@golang.org>
            Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
            Gerrit-Reviewer: Russ Cox <r...@golang.org>
            Gerrit-Comment-Date: Thu, 19 Jul 2018 14:04:19 +0000

            Gobot Gobot (Gerrit)

            unread,
            Jul 19, 2018, 10:05:42 AM7/19/18
            to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

            Build is still in progress...

            This change failed on misc-compile-ppc:
            See https://storage.googleapis.com/go-build-log/4aea304f/misc-compile-ppc_20b55f4d.log

            Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report.

            View Change

              To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
              Gerrit-Change-Number: 124707
              Gerrit-PatchSet: 2
              Gerrit-Owner: Russ Cox <r...@golang.org>
              Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
              Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
              Gerrit-Reviewer: Russ Cox <r...@golang.org>
              Gerrit-Comment-Date: Thu, 19 Jul 2018 14:05:40 +0000

              Gobot Gobot (Gerrit)

              unread,
              Jul 19, 2018, 10:25:08 AM7/19/18
              to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

              19 of 19 TryBots failed:

              Failed on misc-compile-ppc: https://storage.googleapis.com/go-build-log/4aea304f/misc-compile-ppc_20b55f4d.log
              Failed on misc-compile: https://storage.googleapis.com/go-build-log/4aea304f/misc-compile_7e6cfb0f.log
              Failed on misc-compile-nacl: https://storage.googleapis.com/go-build-log/4aea304f/misc-compile-nacl_083a32fb.log
              Failed on misc-compile-mips: https://storage.googleapis.com/go-build-log/4aea304f/misc-compile-mips_23844fdf.log
              Failed on linux-amd64: https://storage.googleapis.com/go-build-log/4aea304f/linux-amd64_f8c05b13.log
              Failed on misc-compile-netbsd: https://storage.googleapis.com/go-build-log/4aea304f/misc-compile-netbsd_11c3e749.log
              Failed on misc-compile-openbsd: https://storage.googleapis.com/go-build-log/4aea304f/misc-compile-openbsd_0a5a6480.log
              Failed on windows-amd64-2016: https://storage.googleapis.com/go-build-log/4aea304f/windows-amd64-2016_438e386c.log
              Failed on misc-compile-freebsd: https://storage.googleapis.com/go-build-log/4aea304f/misc-compile-freebsd_da07554b.log
              Failed on linux-amd64-race: https://storage.googleapis.com/go-build-log/4aea304f/linux-amd64-race_e6d6108c.log
              Failed on misc-compile-plan9: https://storage.googleapis.com/go-build-log/4aea304f/misc-compile-plan9_cbab3c5d.log
              Failed on nacl-386: https://storage.googleapis.com/go-build-log/4aea304f/nacl-386_93845389.log
              Failed on misc-vet-vetall: https://storage.googleapis.com/go-build-log/4aea304f/misc-vet-vetall_29bfe4f5.log
              Failed on linux-386: https://storage.googleapis.com/go-build-log/4aea304f/linux-386_125a5238.log
              Failed on freebsd-amd64-11_1: https://storage.googleapis.com/go-build-log/4aea304f/freebsd-amd64-11_1_85d94fcb.log
              Failed on js-wasm: https://storage.googleapis.com/go-build-log/4aea304f/js-wasm_3ebfc0a1.log
              Failed on windows-386-2008: https://storage.googleapis.com/go-build-log/4aea304f/windows-386-2008_f4a5e043.log
              Failed on nacl-amd64p32: https://storage.googleapis.com/go-build-log/4aea304f/nacl-amd64p32_5bb09cd2.log
              Failed on openbsd-amd64-62: https://storage.googleapis.com/go-build-log/4aea304f/openbsd-amd64-62_2114744b.log

              Consult https://build.golang.org/ to see whether they are new failures.

              Patch set 2:TryBot-Result -1

              View Change

                To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                Gerrit-Project: go
                Gerrit-Branch: master
                Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                Gerrit-Change-Number: 124707
                Gerrit-PatchSet: 2
                Gerrit-Owner: Russ Cox <r...@golang.org>
                Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                Gerrit-Reviewer: Russ Cox <r...@golang.org>
                Gerrit-Comment-Date: Thu, 19 Jul 2018 14:25:06 +0000

                Russ Cox (Gerrit)

                unread,
                Jul 19, 2018, 11:03:28 AM7/19/18
                to Russ Cox, goph...@pubsubhelper.golang.org, Gobot Gobot, Bryan C. Mills, golang-co...@googlegroups.com

                Uploaded patch set 3: Patch Set 2 was rebased.

                View Change

                  To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                  Gerrit-Change-Number: 124707
                  Gerrit-PatchSet: 3
                  Gerrit-Owner: Russ Cox <r...@golang.org>
                  Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                  Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                  Gerrit-Reviewer: Russ Cox <r...@golang.org>
                  Gerrit-Comment-Date: Thu, 19 Jul 2018 15:03:22 +0000

                  Gobot Gobot (Gerrit)

                  unread,
                  Jul 19, 2018, 11:03:42 AM7/19/18
                  to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

                  TryBots beginning. Status page: https://farmer.golang.org/try?commit=a1b7bbd8

                  View Change

                    To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-Project: go
                    Gerrit-Branch: master
                    Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                    Gerrit-Change-Number: 124707
                    Gerrit-PatchSet: 3
                    Gerrit-Owner: Russ Cox <r...@golang.org>
                    Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                    Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                    Gerrit-Reviewer: Russ Cox <r...@golang.org>
                    Gerrit-Comment-Date: Thu, 19 Jul 2018 15:03:40 +0000

                    Gobot Gobot (Gerrit)

                    unread,
                    Jul 19, 2018, 11:05:12 AM7/19/18
                    to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

                    Build is still in progress...
                    This change failed on misc-compile-ppc:

                    See https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile-ppc_12d3aec9.log

                    Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report.

                    View Change

                      To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                      Gerrit-Project: go
                      Gerrit-Branch: master
                      Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                      Gerrit-Change-Number: 124707
                      Gerrit-PatchSet: 3
                      Gerrit-Owner: Russ Cox <r...@golang.org>
                      Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                      Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                      Gerrit-Reviewer: Russ Cox <r...@golang.org>
                      Gerrit-Comment-Date: Thu, 19 Jul 2018 15:05:10 +0000

                      Gobot Gobot (Gerrit)

                      unread,
                      Jul 19, 2018, 11:24:57 AM7/19/18
                      to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

                      19 of 19 TryBots failed:

                      Failed on misc-compile-ppc: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile-ppc_12d3aec9.log
                      Failed on misc-compile: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile_3aae84f2.log
                      Failed on misc-compile-nacl: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile-nacl_a99662ed.log
                      Failed on misc-compile-openbsd: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile-openbsd_3aaf6a81.log
                      Failed on misc-compile-netbsd: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile-netbsd_c2a8dd89.log
                      Failed on misc-compile-mips: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile-mips_bba69c18.log
                      Failed on misc-compile-plan9: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile-plan9_60c63356.log
                      Failed on misc-compile-freebsd: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-compile-freebsd_a7e65e64.log
                      Failed on nacl-amd64p32: https://storage.googleapis.com/go-build-log/a1b7bbd8/nacl-amd64p32_4748dab6.log
                      Failed on linux-386: https://storage.googleapis.com/go-build-log/a1b7bbd8/linux-386_773c89fd.log
                      Failed on js-wasm: https://storage.googleapis.com/go-build-log/a1b7bbd8/js-wasm_3c9c7f32.log
                      Failed on linux-amd64: https://storage.googleapis.com/go-build-log/a1b7bbd8/linux-amd64_0031f34f.log
                      Failed on misc-vet-vetall: https://storage.googleapis.com/go-build-log/a1b7bbd8/misc-vet-vetall_eec48236.log
                      Failed on openbsd-amd64-62: https://storage.googleapis.com/go-build-log/a1b7bbd8/openbsd-amd64-62_ea1cf7d2.log
                      Failed on linux-amd64-race: https://storage.googleapis.com/go-build-log/a1b7bbd8/linux-amd64-race_709f6111.log
                      Failed on nacl-386: https://storage.googleapis.com/go-build-log/a1b7bbd8/nacl-386_c87c8d36.log
                      Failed on windows-amd64-2016: https://storage.googleapis.com/go-build-log/a1b7bbd8/windows-amd64-2016_f30373a6.log
                      Failed on freebsd-amd64-11_1: https://storage.googleapis.com/go-build-log/a1b7bbd8/freebsd-amd64-11_1_967b1b38.log
                      Failed on windows-386-2008: https://storage.googleapis.com/go-build-log/a1b7bbd8/windows-386-2008_13433298.log

                      Consult https://build.golang.org/ to see whether they are new failures.

                      Patch set 3:TryBot-Result -1

                      View Change

                        To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                        Gerrit-Change-Number: 124707
                        Gerrit-PatchSet: 3
                        Gerrit-Owner: Russ Cox <r...@golang.org>
                        Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                        Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                        Gerrit-Reviewer: Russ Cox <r...@golang.org>
                        Gerrit-Comment-Date: Thu, 19 Jul 2018 15:24:55 +0000

                        Russ Cox (Gerrit)

                        unread,
                        Jul 19, 2018, 12:16:12 PM7/19/18
                        to Russ Cox, goph...@pubsubhelper.golang.org, Gobot Gobot, Bryan C. Mills, golang-co...@googlegroups.com

                        Uploaded patch set 4.

                        View Change

                          To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                          Gerrit-Change-Number: 124707
                          Gerrit-PatchSet: 4
                          Gerrit-Owner: Russ Cox <r...@golang.org>
                          Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                          Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                          Gerrit-Reviewer: Russ Cox <r...@golang.org>
                          Gerrit-Comment-Date: Thu, 19 Jul 2018 16:16:06 +0000

                          Russ Cox (Gerrit)

                          unread,
                          Jul 19, 2018, 12:16:12 PM7/19/18
                          to Russ Cox, Gobot Gobot, Bryan C. Mills, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

                          Russ Cox uploaded patch set #4 to this change.

                          View Change

                          cmd/go: document $GOPROXY, other module adjustments

                          Also document module use of GOPATH including GOPATH/src/mod
                          and GOPATH/bin (unless GOBIN is set).

                          Fixes #26399.
                          Fixes #26406.

                          Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                          ---
                          M src/cmd/go/internal/help/helpdoc.go
                          M src/cmd/go/internal/modfetch/proxy.go
                          M src/cmd/go/internal/modload/help.go
                          3 files changed, 118 insertions(+), 9 deletions(-)

                          To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                          Gerrit-Change-Number: 124707
                          Gerrit-PatchSet: 4
                          Gerrit-Owner: Russ Cox <r...@golang.org>
                          Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                          Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                          Gerrit-Reviewer: Russ Cox <r...@golang.org>
                          Gerrit-MessageType: newpatchset

                          Gobot Gobot (Gerrit)

                          unread,
                          Jul 19, 2018, 12:16:24 PM7/19/18
                          to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

                          TryBots beginning. Status page: https://farmer.golang.org/try?commit=8b76582e

                          View Change

                            To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                            Gerrit-Change-Number: 124707
                            Gerrit-PatchSet: 4
                            Gerrit-Owner: Russ Cox <r...@golang.org>
                            Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                            Gerrit-Reviewer: Russ Cox <r...@golang.org>
                            Gerrit-Comment-Date: Thu, 19 Jul 2018 16:16:20 +0000

                            Bryan C. Mills (Gerrit)

                            unread,
                            Jul 19, 2018, 12:37:02 PM7/19/18
                            to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, Gobot Gobot, golang-co...@googlegroups.com

                            Patch set 4:Code-Review +2

                            View Change

                            7 comments:

                              • for resolving the meaning of imports during a build, but it is still used

                              • for holding

                                s/it is still used for holding (.*) and storing (.*)/it still holds \1 and stores \2/

                            To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                            Gerrit-Change-Number: 124707
                            Gerrit-PatchSet: 4
                            Gerrit-Owner: Russ Cox <r...@golang.org>
                            Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                            Gerrit-Reviewer: Russ Cox <r...@golang.org>
                            Gerrit-Comment-Date: Thu, 19 Jul 2018 16:37:00 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: Yes
                            Gerrit-MessageType: comment

                            Gobot Gobot (Gerrit)

                            unread,
                            Jul 19, 2018, 12:41:50 PM7/19/18
                            to Russ Cox, goph...@pubsubhelper.golang.org, Bryan C. Mills, golang-co...@googlegroups.com

                            TryBots are happy.

                            Patch set 4:TryBot-Result +1

                            View Change

                              To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                              Gerrit-Change-Number: 124707
                              Gerrit-PatchSet: 4
                              Gerrit-Owner: Russ Cox <r...@golang.org>
                              Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                              Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                              Gerrit-Reviewer: Russ Cox <r...@golang.org>
                              Gerrit-Comment-Date: Thu, 19 Jul 2018 16:41:48 +0000

                              Russ Cox (Gerrit)

                              unread,
                              Jul 19, 2018, 2:15:45 PM7/19/18
                              to Russ Cox, Gobot Gobot, Bryan C. Mills, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

                              Russ Cox uploaded patch set #5 to this change.

                              View Change

                              cmd/go: document $GOPROXY, other module adjustments

                              Also document module use of GOPATH including GOPATH/src/mod
                              and GOPATH/bin (unless GOBIN is set).

                              Fixes #26399.
                              Fixes #26406.

                              Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                              ---
                              M src/cmd/go/internal/help/helpdoc.go
                              M src/cmd/go/internal/modfetch/proxy.go
                              M src/cmd/go/internal/modload/help.go
                              3 files changed, 116 insertions(+), 9 deletions(-)

                              To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                              Gerrit-Change-Number: 124707
                              Gerrit-PatchSet: 5
                              Gerrit-Owner: Russ Cox <r...@golang.org>
                              Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                              Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                              Gerrit-Reviewer: Russ Cox <r...@golang.org>
                              Gerrit-MessageType: newpatchset

                              Russ Cox (Gerrit)

                              unread,
                              Jul 19, 2018, 2:15:46 PM7/19/18
                              to Russ Cox, goph...@pubsubhelper.golang.org, Gobot Gobot, Bryan C. Mills, golang-co...@googlegroups.com

                              Uploaded patch set 5.

                              (7 comments)

                              View Change

                              7 comments:

                                • s/They are/It is/ or s/They/Import path comments/

                                • s/when/for/ (since the sentence starts with “when”)

                                • parentheses would be easier for me to parse than commas here.

                                • the meaning of imports
                                  during a buil

                                  s/as the mechanism for resolving/to resolve/

                                  Done

                                • during a build, but it still stores downloaded dependencies (in GOPATH/src/mod)
                                  and install

                                  s/it is still used for holding (.*) and storing (. […]

                                  Done

                              To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                              Gerrit-Change-Number: 124707
                              Gerrit-PatchSet: 5
                              Gerrit-Owner: Russ Cox <r...@golang.org>
                              Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                              Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                              Gerrit-Reviewer: Russ Cox <r...@golang.org>
                              Gerrit-Comment-Date: Thu, 19 Jul 2018 18:15:43 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              Comment-In-Reply-To: Bryan C. Mills <bcm...@google.com>
                              Gerrit-MessageType: comment

                              Russ Cox (Gerrit)

                              unread,
                              Jul 19, 2018, 2:15:46 PM7/19/18
                              to Russ Cox, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Gobot Gobot, Bryan C. Mills, golang-co...@googlegroups.com

                              Russ Cox merged this change.

                              View Change

                              Approvals: Bryan C. Mills: Looks good to me, approved
                              cmd/go: document $GOPROXY, other module adjustments

                              Also document module use of GOPATH including GOPATH/src/mod
                              and GOPATH/bin (unless GOBIN is set).

                              Fixes #26399.
                              Fixes #26406.

                              Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                              Reviewed-on: https://go-review.googlesource.com/124707
                              Reviewed-by: Bryan C. Mills <bcm...@google.com>

                              ---
                              M src/cmd/go/internal/help/helpdoc.go
                              M src/cmd/go/internal/modfetch/proxy.go
                              M src/cmd/go/internal/modload/help.go
                              3 files changed, 116 insertions(+), 9 deletions(-)

                              diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go
                              index a5cfffd..c6dfaad 100644
                              +When using modules, downloaded packages are stored in the module cache.
                              +(See 'go help modules-get' and 'go help goproxy'.)

                              +
                              +When using modules, an additional variant of the go-import meta tag is
                              +recognized and is preferred over those listing version control systems.
                              +That variant uses "mod" as the vcs in the content value, as in:
                              +
                              + <meta name="go-import" content="example.org mod https://code.org/moduleproxy">
                              +
                              +This tag means to fetch modules with paths beginning with example.org
                              +from the module proxy available at the URL https://code.org/moduleproxy.
                              +See 'go help goproxy' for details about the proxy protocol.

                              Import path checking

                              @@ -288,6 +299,9 @@
                              This makes it possible to copy code into alternate locations in vendor trees
                              without needing to update import comments.

                              +Import path checking is also disabled when using modules.
                              +Import path comments are obsoleted by the go.mod file's module statement.

                              +
                              See https://golang.org/s/go14customimport for details.
                              `,
                              }
                              @@ -360,6 +374,12 @@

                              See https://golang.org/doc/code.html for an example.

                              +GOPATH and Modules
                              +
                              +When using modules, GOPATH is no longer used for resolving imports.
                              +However, it is still used to store downloaded source code (in GOPATH/src/mod)
                              +and compiled commands (in GOPATH/bin).

                              +
                              Internal Directories

                              Code in or below a directory named "internal" is importable only
                              @@ -471,6 +491,8 @@
                              Examples are linux, darwin, windows, netbsd.
                              GOPATH
                              For more details see: 'go help gopath'.
                              + GOPROXY
                              + URL of Go module proxy. See 'go help goproxy'.
                              GORACE
                              Options for the race detector.
                              See https://golang.org/doc/articles/race_detector.html.
                              diff --git a/src/cmd/go/internal/modfetch/proxy.go b/src/cmd/go/internal/modfetch/proxy.go
                              index 4cc7457..ffd65d4 100644
                              --- a/src/cmd/go/internal/modfetch/proxy.go
                              +++ b/src/cmd/go/internal/modfetch/proxy.go
                              @@ -14,18 +14,85 @@
                              "strings"
                              "time"

                              + "cmd/go/internal/base"
                              "cmd/go/internal/modfetch/codehost"
                              "cmd/go/internal/module"

                              "cmd/go/internal/semver"
                              )

                              +var HelpGoproxy = &base.Command{
                              + UsageLine: "goproxy",
                              + Short: "module proxy protocol",
                              + Long: `
                              +The go command by default downloads modules from version control systems
                              +`,

                              +}
                              +
                              var proxyURL = os.Getenv("GOPROXY")

                              func lookupProxy(path string) (Repo, error) {
                              + if strings.Contains(proxyURL, ",") {
                              + return nil, fmt.Errorf("invalid $GOPROXY setting: cannot have comma")
                              + }
                              u, err := url.Parse(proxyURL)
                              if err != nil || u.Scheme != "http" && u.Scheme != "https" && u.Scheme != "file" {
                              // Don't echo $GOPROXY back in case it has user:password in it (sigh).
                              - return nil, fmt.Errorf("invalid $GOPROXY setting")
                              + return nil, fmt.Errorf("invalid $GOPROXY setting: malformed URL or invalid scheme (must be http, https, file)")
                              }
                              return newProxyRepo(u.String(), path)
                              }
                              diff --git a/src/cmd/go/internal/modload/help.go b/src/cmd/go/internal/modload/help.go
                              index 8b3b5a3..3efa708 100644
                              --- a/src/cmd/go/internal/modload/help.go
                              +++ b/src/cmd/go/internal/modload/help.go
                              @@ -49,6 +49,10 @@

                              GOPATH/src and itself contains a go.mod file or is below a directory
                              containing a go.mod file.

                              +In module-aware mode, GOPATH no longer defines the meaning of imports
                              +during a build, but it still stores downloaded dependencies (in GOPATH/src/mod)
                              +and installed commands (in GOPATH/bin, unless GOBIN is set).

                              +
                              Defining a module

                              A module is defined by a tree of Go source files with a go.mod file
                              @@ -245,7 +249,6 @@

                              go get github.com/gorilla/mux@c856192 # records v0.0.0-20180517173623-c85619274f5d
                              go get github.com/gorilla/mux@master # records current meaning of master

                              -
                              Module compatibility and semantic versioning

                              The go command requires that modules use semantic versions and expects that
                              @@ -314,7 +317,15 @@
                              semantic import versioning, and see https://semver.org/ for more about
                              semantic versioning.


                              -Module verification
                              +Module code layout
                              +
                              +For now, see https://research.swtch.com/vgo-module for information
                              +about how source code in version control systems is mapped to
                              +module file trees.
                              +
                              +TODO: Add documentation to go command.
                              +
                              +Module downloading and verification

                              The go command maintains, in the main module's root directory alongside
                              go.mod, a file named go.sum containing the expected cryptographic checksums
                              @@ -330,6 +341,13 @@

                              the cached copies of module downloads still match both their recorded
                              checksums and the entries in go.sum.

                              +The go command can fetch modules from a proxy instead of connecting
                              +to source control systems directly, according to the setting of the GOPROXY
                              +environment variable.
                              +
                              +See 'go help goproxy' for details about the proxy and also the format of
                              +the cached downloaded packages.
                              +
                              Modules and vendoring

                              When using modules, the go command completely ignores vendor directories.

                              To view, visit change 124707. To unsubscribe, or for help writing mail filters, visit settings.

                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: I7be8eaf110f4fa6fc76ea4cd39aea3dd8addf0b0
                              Gerrit-Change-Number: 124707
                              Gerrit-PatchSet: 6
                              Gerrit-Owner: Russ Cox <r...@golang.org>
                              Gerrit-Reviewer: Bryan C. Mills <bcm...@google.com>
                              Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                              Gerrit-Reviewer: Russ Cox <r...@golang.org>
                              Gerrit-MessageType: merged
                              Reply all
                              Reply to author
                              Forward
                              0 new messages