x/tools/cmd/goimports: weird behaviours - not importing and removing dependencies automatically #34518
Labels
FrozenDueToAge
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it does
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Using
goimports -w file.go
or throughvim-go
.What did you expect to see?
Dependencies (external or internal) should be auto imported.
What did you see instead?
It doesn't auto-import packages from the same project/module, it doesn't fetch external packages and sometimes, even if I add import statements manually it scrapes it. Example: I am using
strconv.itoa
and even if I add strconv to imports statement, goimports removes it.I thought initially it was a vim-go issue, but I've tried
goimports -w file.go
and it doesn't as expected.Side note: if I run
go get ...
, it doesn't scrape the dependency.The text was updated successfully, but these errors were encountered: