Skip to content

x/tools/cmd/goimports: Goimports removes valid import paths when pkgName != dirName #28646

@VojtechVitek

Description

@VojtechVitek

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

$ go version
go version go1.11.1 darwin/amd64

Does this issue reproduce with the latest release?

go get -u -v golang.org/x/tools/cmd/goimports

As of writing, goimports are on this commit: golang/tools@4ca4995

Regression reproducer

Please, see a reproducer repo: https://github.com/VojtechVitek/goimports-bug

Issue

Seems like latest goimports started removing completely valid import paths when package name doesn't match the pkg's directory name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions