]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13] cmd/go: strip trailing slash from versioned arguments
authorJay Conrod <jayconrod@google.com>
Tue, 10 Sep 2019 20:06:12 +0000 (16:06 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 11 Sep 2019 20:34:36 +0000 (20:34 +0000)
commitf0c623086396faf308fb7e626bf4bf8a5010c857
tree4a31459e3b1aab9082a573dd7cfac161c6292aaa
parent052d7c80748ada786d12b27e58a4f63f118c1aef
[release-branch.go1.13] 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.

Fixes #34243

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>
(cherry picked from commit 8875fb97c5cadbc6f02e4ce89efa586023c0a777)
Reviewed-on: https://go-review.googlesource.com/c/go/+/194687
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]