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: report changes and resolved versions in 'go get'
Fixes golang#33284 Change-Id: I33daa5eb518985bc7308f29655e04c57e244b479 Reviewed-on: https://go-review.googlesource.com/c/go/+/269018 Run-TryBot: Jay Conrod <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Jay Conrod <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Jay Conrod
committed
Nov 20, 2020
1 parent
012efc6
commit 5e58ae4
Showing
2 changed files
with
145 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# When adding a requirement, 'go get' prints a message for the requirement | ||
# and for changed explicit dependencies. 'go get' does not print messages | ||
# for changed indirect dependencies. | ||
go list -m all | ||
! stdout golang.org/x/text | ||
go get -d rsc.io/[email protected] | ||
stderr '^go get: added rsc.io/quote v1.5.2$' | ||
stderr '^go get: upgraded rsc.io/sampler v1.0.0 => v1.3.0$' | ||
! stderr '^go get.*golang.org/x/text' | ||
go list -m all | ||
stdout golang.org/x/text | ||
cmp go.mod go.mod.upgrade | ||
|
||
# When removing a requirement, 'go get' prints a message for the requiremnent | ||
# and for changed explicit dependencies. 'go get' does not print messages | ||
# for changed indirect dependencies. | ||
go get -d rsc.io/sampler@none | ||
stderr '^go get: downgraded rsc.io/quote v1.5.2 => v1.3.0$' | ||
stderr '^go get: removed rsc.io/sampler v1.3.0$' | ||
! stderr '^go get.*golang.org/x/text' | ||
cmp go.mod go.mod.downgrade | ||
|
||
# When removing or downgrading a requirement, 'go get' also prints a message | ||
# for explicit dependencies removed as a consequence. | ||
cp go.mod.usequote go.mod | ||
go get -d rsc.io/[email protected] | ||
stderr '^go get: downgraded rsc.io/quote v1.5.2 => v1.5.1$' | ||
stderr '^go get: removed usequote v0.0.0$' | ||
|
||
-- go.mod -- | ||
module m | ||
|
||
go 1.16 | ||
|
||
require rsc.io/sampler v1.0.0 | ||
-- go.sum -- | ||
rsc.io/sampler v1.0.0 h1:SRJnjyQ07sAtq6G4RcfJEmz8JxqLyj3PoGXG2VhbDWo= | ||
rsc.io/sampler v1.0.0/go.mod h1:cqxpM3ZVz9VtirqxZPmrWzkQ+UkiNiGtkrN+B+i8kx8= | ||
-- go.mod.upgrade -- | ||
module m | ||
|
||
go 1.16 | ||
|
||
require ( | ||
rsc.io/quote v1.5.2 // indirect | ||
rsc.io/sampler v1.3.0 | ||
) | ||
-- go.mod.downgrade -- | ||
module m | ||
|
||
go 1.16 | ||
|
||
require ( | ||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect | ||
rsc.io/quote v1.3.0 // indirect | ||
) | ||
-- go.mod.usequote -- | ||
module m | ||
|
||
go 1.16 | ||
|
||
require usequote v0.0.0 | ||
|
||
replace usequote => ./usequote | ||
-- usequote/go.mod -- | ||
module usequote | ||
|
||
go 1.16 | ||
|
||
require rsc.io/quote v1.5.2 |