Skip to content
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/tools/cmd/goimports: does not import when package name has an underscore (and different path) #21545

Closed
celrenheit opened this issue Aug 21, 2017 · 1 comment
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@celrenheit
Copy link

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 ?

@gopherbot gopherbot added this to the Unreleased milestone Aug 21, 2017
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@heschi
Copy link
Contributor

heschi commented Nov 7, 2019

The underscore in grpc_prometheus is unusual for a Go package, and generally we want to encourage directory names to match package names. Given that, and the age of this issue, I'm going to close this. Please comment if you're still having trouble.

@heschi heschi closed this as completed Nov 7, 2019
@golang golang locked and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants