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
If I have an anonymous import in a package that uses Wire, that import gets copied to wire_gen.go, but it gets copied in some separate import declaration instead of being part of the rest of the imports.
To Reproduce
The PkgImport test has an example of this behavior:
Anonymous imports were being special-cased and written out separately. They're not that special though, we can just count them as regular imports with the name "_".
This causes them to get grouped together with the other imports like one would expect, and simplifies the generator a bit.
Fixesgoogle#358.
Describe the bug
If I have an anonymous import in a package that uses Wire, that import gets copied to wire_gen.go, but it gets copied in some separate import declaration instead of being part of the rest of the imports.
To Reproduce
The PkgImport test has an example of this behavior:
wire/internal/wire/testdata/PkgImport/want/wire_gen.go
Line 13 in 8b20581
This is legal, but not really idiomatic. In particular
goimports
doesn't care for it, and it doesn't match any other Go code I've seen in the wild.Expected behavior
Imports being all part of the same import declaration, like most Go code:
Version
0.5.0
Additional context
This is causing issues with the goimports check in our CI.
The text was updated successfully, but these errors were encountered: