-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release-branch.go1.16] cmd/go: allow '+' in package import paths in …
…module mode This change upgrades x/mod to pull in the fix from CL 300152. Updates #44776. Fixes #44885. Change-Id: I273f41df2abfff76d91315b7f19fce851c8770d8 Reviewed-on: https://go-review.googlesource.com/c/go/+/300176 Trust: Bryan C. Mills <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> Reviewed-by: Jay Conrod <[email protected]> TryBot-Result: Go Bot <[email protected]> (cherry picked from commit d33e219) Reviewed-on: https://go-review.googlesource.com/c/go/+/300153
- Loading branch information
Showing
5 changed files
with
66 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# https://golang.org/issue/44776 | ||
# The '+' character should be disallowed in module paths, but allowed in package | ||
# paths within valid modules. | ||
|
||
go get -d example.net/cmd | ||
go list example.net/cmd/x++ | ||
|
||
! go list -versions -m 'example.net/bad++' | ||
stderr '^go list -m: module example.net/bad\+\+: malformed module path "example.net/bad\+\+": invalid char ''\+''$' | ||
|
||
# TODO(bcmills): 'go get -d example.net/cmd/x++' should also work, but currently | ||
# it does not. This might be fixed by https://golang.org/cl/297891. | ||
! go get -d example.net/cmd/x++ | ||
stderr '^go get: malformed module path "example.net/cmd/x\+\+": invalid char ''\+''$' | ||
|
||
-- go.mod -- | ||
module example.com/m | ||
|
||
go 1.16 | ||
|
||
replace ( | ||
example.net/cmd => ./cmd | ||
) | ||
|
||
-- cmd/go.mod -- | ||
module example.net/cmd | ||
|
||
go 1.16 | ||
-- cmd/x++/main.go -- | ||
package main | ||
|
||
func main() {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters