mirror of https://github.com/golang/go.git
cmd/go/internal/modget: fix get pkg@none
Now pkg@none actually removes the pkg instead of dying. For #26342. Change-Id: I9df7281ed8fd24480109b36f33a563f92e279244 Reviewed-on: https://go-review.googlesource.com/124796 Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
parent
269a93823c
commit
9039c2c0bf
|
|
@ -356,16 +356,17 @@ func runGet(cmd *base.Command, args []string) {
|
|||
}
|
||||
lookup.Do(10, func(item interface{}) {
|
||||
t := item.(*task)
|
||||
if t.vers == "none" {
|
||||
// Wait for downgrade step.
|
||||
t.m = module.Version{Path: t.path, Version: "none"}
|
||||
return
|
||||
}
|
||||
m, err := getQuery(t.path, t.vers, t.forceModulePath)
|
||||
if err != nil {
|
||||
base.Errorf("go get %v: %v", t.arg, err)
|
||||
return
|
||||
}
|
||||
t.m = m
|
||||
if t.vers == "none" {
|
||||
// Wait for downgrade step.
|
||||
return
|
||||
}
|
||||
// If there is no -u, then we don't need to upgrade the
|
||||
// collected requirements separately from the overall
|
||||
// recalculation of the build list (modload.ReloadBuildList below),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
env GO111MODULE=on
|
||||
|
||||
go get rsc.io/quote@v2.0.0
|
||||
# downgrade sampler should downgrade quote
|
||||
go get rsc.io/sampler@v1.0.0
|
||||
go list -m all
|
||||
stdout 'rsc.io/quote v0.0.0-'
|
||||
stdout 'rsc.io/quote v1.4.0'
|
||||
stdout 'rsc.io/sampler v1.0.0'
|
||||
|
||||
# downgrade sampler away should downgrade quote further
|
||||
go get rsc.io/sampler@none
|
||||
go list -m all
|
||||
stdout 'rsc.io/quote v1.3.0'
|
||||
|
||||
-- go.mod --
|
||||
module x
|
||||
|
|
|
|||
Loading…
Reference in New Issue