-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anonymous imports get pushed into a separate import declaration #358
Comments
reillywatson
added a commit
to reillywatson/wire
that referenced
this issue
May 10, 2022
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. Fixes google#358.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: