x/tools/cmd/goimports: import incorrectly rewritten #43212
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I just go-get'ed goimports to format my code as usual:
goimports -w -l *.go
Then one of imports was changed from "github.com/Komosa/persistent-cookiejar" to "net/http/cookiejar" and code no longer compiles.
Here is minimal example: https://play.golang.org/p/T6ix7FGFPCn
As a side note: I have both packages installed. While I was minimizing the example, sometimes my desired import was preserved (thus named
cookiejar "github...."
). But I was unable to see any rule for this behavior.What did you expect to see?
I would expect no rewrite for already-working imports.
What did you see instead?
Import is changed.
The text was updated successfully, but these errors were encountered: