]> Cypherpunks repositories - gostls13.git/commit
cmd/go: strip trailing slash from versioned arguments
authorJay Conrod <jayconrod@google.com>
Tue, 10 Sep 2019 20:06:12 +0000 (16:06 -0400)
committerJay Conrod <jayconrod@google.com>
Wed, 11 Sep 2019 20:19:25 +0000 (20:19 +0000)
commit8875fb97c5cadbc6f02e4ce89efa586023c0a777
tree3c96d4ef01698454eaa1826d72d2642882ee9824
parent04867cd89121d9738fb16e8f299a9263a91282eb
cmd/go: strip trailing slash from versioned arguments

'go get' accepts arguments of the form path@version, and it passes
them through search.CleanPatterns before querying proxies. With this
change, CleanPatterns preserves text after '@' and will strip trailing
slashes from the patn.

Previously, we did not strip trailing slashes when a version was
present, which caused proxy base URL validation to fail. Module paths
that end with ".go" (for example, github.com/nats-io/nats.go) use
trailing slashes to prevent 'go build' and other commands from
interpreting packages as source file names, so this caused unnecessary
problems for them.

Updates #32483

Change-Id: Id3730c52089e52f1cac446617c20132a3021a808
Reviewed-on: https://go-review.googlesource.com/c/go/+/194600
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/search/search.go
src/cmd/go/testdata/mod/example.com_dotgo.go_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_get_trailing_slash.txt [new file with mode: 0644]