You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My fix for #34383 was incomplete: it failed to take into account the possibility that the longest path for the module would be a *PackageNotInModuleError, in which case we should prefer the *PackageNotInModuleError over an unclassified error from a module with a shorter path.
A reproducer:
example.com$ gotip version
go version devel +cfe23204 Sun Oct 6 18:18:50 2019 +0000 linux/amd64
example.com$ GOPROXY=direct gotip get vcs-test.golang.org/git/empty-v2-without-v1.git/[email protected]
go: finding vcs-test.golang.org/git/empty-v2-without-v1.git v2.0.0
go get vcs-test.golang.org/git/empty-v2-without-v1.git/[email protected]: vcs-test.golang.org/git/[email protected]: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2
…dule loading
In CL 197059, I suppressed errors if the target package was already found.
However, that does not cover the case of passing a '/v2' module path to
'go get' when the module does not contain a package at its root.
This CL is a minimal fix for that case, intended to be backportable to 1.13.
(Longer term, I intend to rework the version-validation check to treat
all mismatched paths as ErrNotExist.)
Updates #34746Fixes#34747
Change-Id: Ia963c2ea00fae424812b8f46a4d6c2c668252147
Reviewed-on: https://go-review.googlesource.com/c/go/+/199839
Run-TryBot: Bryan C. Mills <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Jay Conrod <[email protected]>
(cherry picked from commit 421d35c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/199997
My fix for #34383 was incomplete: it failed to take into account the possibility that the longest path for the module would be a
*PackageNotInModuleError
, in which case we should prefer the*PackageNotInModuleError
over an unclassified error from a module with a shorter path.A reproducer:
CC @jayconrod
The text was updated successfully, but these errors were encountered: