-
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.
cmd/go: in 'go mod edit', validate versions given to -retract and -ex…
…clude Fixes #43280 Change-Id: Icb6c6807fe32a89202a2709d4a1c8d8af967628f Reviewed-on: https://go-review.googlesource.com/c/go/+/283853 Trust: Jay Conrod <[email protected]> Run-TryBot: Jay Conrod <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Jay Conrod
committed
Jan 14, 2021
1 parent
eb33002
commit e125ccd
Showing
5 changed files
with
40 additions
and
4 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 |
---|---|---|
|
@@ -21,6 +21,12 @@ cmpenv go.mod $WORK/go.mod.edit1 | |
go mod edit -droprequire=x.1 [email protected] [email protected] [email protected] -dropretract=v1.0.0 -dropretract=[v1.1.0,v1.2.0] | ||
cmpenv go.mod $WORK/go.mod.edit2 | ||
|
||
# -exclude and -retract reject invalid versions. | ||
! go mod edit -exclude=example.com/m@bad | ||
stderr '^go mod: -exclude=example.com/m@bad: version "bad" invalid: must be of the form v1.2.3$' | ||
! go mod edit -retract=bad | ||
stderr '^go mod: -retract=bad: version "bad" invalid: must be of the form v1.2.3$' | ||
|
||
# go mod edit -json | ||
go mod edit -json | ||
cmpenv stdout $WORK/go.mod.json | ||
|
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