You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to see that goimports suggest to change code like this: https://play.golang.org/p/R7QEiX-e8io
Group local imports in several sections to one import section.
What did you see instead?
goimport do not to suggest any changes
Is it a feature or a bug?
The text was updated successfully, but these errors were encountered:
We intentionally leave this to local custom - gofmt and goimports will never move imports across blank lines in the import block. So if I want path with the others, I can do that, and gofmt/goimports respect that. And if you want all your renamed imports together, you can do that, and gofmt/goimports respect that too.
i.e. imports separated by blank lines are considered separate and that is intentional. Hence gofmt/goimports will not dedup entries beyond a single import group.
Your issue is a much bigger extension of that, which is merging imports across multiple import sections. Applying the same logic above, I would say this is a feature and not a bug. I am going to close this now. Please feel free to comment if you think this was a mistake.
What version of Go are you using (
go version
)?1.9.2
What operating system and processor architecture are you using (
go env
)?amd64
What did you do?
I run goimports on this code: https://play.golang.org/p/hwfKtMHlwmD
What did you expect to see?
I want to see that goimports suggest to change code like this: https://play.golang.org/p/R7QEiX-e8io
Group local imports in several sections to one import section.
What did you see instead?
goimport do not to suggest any changes
Is it a feature or a bug?
The text was updated successfully, but these errors were encountered: