-
Notifications
You must be signed in to change notification settings - Fork 607
Why are imports not formatted with goimports? #393
Comments
Seems reasonable to me. |
@marten-seemann I just took a look quick and it does not appear the goimports has an api we can use unless I missed something in my quick look. To support this we might need to build behavior to mimic how goimports rearranges things. Still a good idea, just had not thought about that initially. |
I believe that goimports uses this under the hood: https://github.com/golang/tools/blob/a49f79bcc2246daebe8647db377475ffc1523d7b/imports/forward.go#L39 - would that suffice? |
I have not tried it out, but that does look promising. |
If this does work, I am open to PRs. |
+1 on this |
It is not being actively worked on, but I would be willing to take a PR for the feature. |
Alright. |
I'm wondering why the imports are not formatted according to
goimports
. When I open a mock file with my editor, it would automatically rearrange the imports, and then I have to revert this change before committing.Considering that there exists a standard format how to arrange import paths, would it make sense if mockgen already arrange the import statements in that order?
The text was updated successfully, but these errors were encountered: