forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: detect inconsistent 'go get' version requests
If x v1.0.0 requires y v1.2.0, then go get [email protected] [email protected] needs to fail gracefully. Fixes golang#25917. Change-Id: I9b426af23a30310fcb0c3545a8d97feb58b8ddbe Reviewed-on: https://go-review.googlesource.com/124800 Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Showing
3 changed files
with
96 additions
and
2 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 |
---|---|---|
|
@@ -11,6 +11,17 @@ go get rsc.io/sampler@none | |
go list -m all | ||
stdout 'rsc.io/quote v1.3.0' | ||
|
||
# downgrade should report inconsistencies and not change go.mod | ||
go get rsc.io/[email protected] | ||
go list -m all | ||
stdout 'rsc.io/quote v1.5.1' | ||
stdout 'rsc.io/sampler v1.3.0' | ||
! go get rsc.io/[email protected] rsc.io/[email protected] golang.org/x/text@none | ||
stderr 'go get: inconsistent versions:\n\trsc.io/[email protected] requires golang.org/x/[email protected] \(not golang.org/x/text@none\), rsc.io/[email protected] \(not rsc.io/[email protected]\)' | ||
go list -m all | ||
stdout 'rsc.io/quote v1.5.1' | ||
stdout 'rsc.io/sampler v1.3.0' | ||
|
||
-- go.mod -- | ||
module x | ||
require rsc.io/quote v1.5.1 | ||
|