importas
importas copied to clipboard
versioned package imports
When importing version 2 or above of a Go module there's a bit of problem with imports that needs clarifying.
https://go.dev/blog/v2-go-modules
If I have
import (
foo "github.com/example/foo/v2"
)
The alias is flagged because the package and the path are not matching , that is foo andv2 are clearly not the same.
foov2 doesn't match either
v2 on its own isn't a good package alias.
Is there a nicer way (instead of listing exclusions in the config) of 'fixing' this?