diff options
author | Jay Conrod <jayconrod@google.com> | 2021-03-23 17:03:46 -0400 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2021-03-24 13:54:14 +0000 |
commit | d8960e65a2386c899d50d7f0c355080865225b94 (patch) | |
tree | c2033ecda9b8a9b6e0171586f42c5e49663107c7 /src/cmd/go/internal/modload/import.go | |
parent | 2e94401277128f9e08e3319903d1b78c09c4ab98 (diff) | |
download | go-d8960e65a2386c899d50d7f0c355080865225b94.tar.gz go-d8960e65a2386c899d50d7f0c355080865225b94.zip |
cmd/go: move psuedo-version and version sorting to x/mod
Fixes #44969
Change-Id: I01e7b1cf73f0f506aa805bbfe4a9ccaed3d44efe
Reviewed-on: https://go-review.googlesource.com/c/go/+/304229
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/import.go')
-rw-r--r-- | src/cmd/go/internal/modload/import.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go index 995641c9f1..31eb0c4874 100644 --- a/src/cmd/go/internal/modload/import.go +++ b/src/cmd/go/internal/modload/import.go @@ -60,7 +60,7 @@ func (e *ImportMissingError) Error() string { if e.replaced.Path != "" { suggestArg := e.replaced.Path - if !modfetch.IsZeroPseudoVersion(e.replaced.Version) { + if !module.IsZeroPseudoVersion(e.replaced.Version) { suggestArg = e.replaced.String() } return fmt.Sprintf("module %s provides package %s and is replaced but not required; to add it:\n\tgo get %s", e.replaced.Path, e.Path, suggestArg) @@ -344,9 +344,9 @@ func queryImport(ctx context.Context, path string) (module.Version, error) { // used from within some other module, the user will be able to upgrade // the requirement to any real version they choose. if _, pathMajor, ok := module.SplitPathVersion(mp); ok && len(pathMajor) > 0 { - mv = modfetch.ZeroPseudoVersion(pathMajor[1:]) + mv = module.ZeroPseudoVersion(pathMajor[1:]) } else { - mv = modfetch.ZeroPseudoVersion("v0") + mv = module.ZeroPseudoVersion("v0") } } mods = append(mods, module.Version{Path: mp, Version: mv}) |