-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/vgo: import path is resolved to the wrong version #25007
Comments
Import path with a In addition to that, #24585 is about vgo incorrectly generating the go.mod file for legacy packages with versions >= v2.0.0 |
At moment (with patch from #24585) with code that imports package hello // import "github.com/FZambia/hello"
import (
"fmt"
"github.com/gomodule/redigo/redis"
)
func DoSomething() {
fmt.Println(redis.ErrPoolExhausted)
} When running
So it still resolves to |
Yes, if github.com/gomodule/redigo does not opt into semantic import versioning by creating a go.mod that says 'module github.com/gomodule/redigo/v2', then you cannot import it using that path. However, you can still import the old name under a pseudo-version. If you run
then vgo will add to go.mod not v2.0.0 (that doesn't match the module path) but instead
which is the same code. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
I've imported a package using versioned syntax:
import _ "github.com/gomodule/redigo/v2/redis"
What did you expect to see?
Version 2.0.0 of redigo imported;
What did you see instead?
Path is resolved to version 1.6 with v2 subdir -
The text was updated successfully, but these errors were encountered: