Skip to content

x/tools/cmd/goimports: does not import when package name has an underscore (and different path) #21545

@celrenheit

Description

@celrenheit

Hello,

What version of Go are you using (go version)?

go version go1.8.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

package main

func main() {
	grpc_prometheus.EnableHandlingTimeHistogram()
}

What did you expect to see?

package main

import "github.com/grpc-ecosystem/go-grpc-prometheus"

func main() {
	grpc_prometheus.EnableHandlingTimeHistogram()
}

What did you see instead?

It did not import the package.

After digging a bit, I found that it is coming from here and here.

goimports currently compares the last two components while removing the hyphens but should it handle underscores too ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions