We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
$ go version go version go1.15.6 darwin/amd64
Yes
For one module, if v1 and v2 all exists in $GOPATH/pkg/mod, goimports will used v1 first.
$GOPATH/pkg/mod
One Example: If grpc-gateway and grpc-gateway/v2 all exists, most of people really need is grpc-gateway/v2.
➜ imports cat main.go package main func main() { var _ = runtime.ServeMux } ➜ imports goimports -d main.go diff -u main.go.orig main.go --- main.go.orig 2021-05-07 21:19:41.000000000 +0800 +++ main.go 2021-05-07 21:19:41.000000000 +0800 @@ -1,5 +1,7 @@ package main +import "github.com/grpc-ecosystem/grpc-gateway/runtime" + func main() { var _ = runtime.ServeMux } ➜ imports ls $GOPATH/pkg/mod/github.com/grpc-ecosystem/grpc-gateway v2@v2.0.1 v2@v2.3.0 v2@v2.4.0 ➜ imports ls $GOPATH/pkg/mod/github.com/grpc-ecosystem/ go-grpc-middleware grpc-gateway grpc-gateway@v1.15.0 go-grpc-middleware@v1.0.0 grpc-gateway@v1.12.1 grpc-gateway@v1.16.0 go-grpc-middleware@v1.0.1-0.20190118093823-f849b5445de4 grpc-gateway@v1.13.0 grpc-gateway@v1.9.0 go-grpc-middleware@v1.2.0 grpc-gateway@v1.14.3 grpc-gateway@v1.9.5 go-grpc-middleware@v1.2.2 grpc-gateway@v1.14.5 grpc-health-probe@v0.3.6 go-grpc-prometheus@v1.2.0 grpc-gateway@v1.14.6 grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645
v2 is used first. Maybe we should change byDistanceOrImportPathShortLength
byDistanceOrImportPathShortLength
The text was updated successfully, but these errors were encountered:
Duplicate of #41800
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
For one module, if v1 and v2 all exists in
$GOPATH/pkg/mod
, goimports will used v1 first.One Example:
If grpc-gateway and grpc-gateway/v2 all exists, most of people really need is grpc-gateway/v2.
What did you expect to see?
v2 is used first.
Maybe we should change
byDistanceOrImportPathShortLength
What did you see instead?
The text was updated successfully, but these errors were encountered: