-
|
gofumpt already does everything that gofmt does (and more). So, what if in our configuration we have both formatters enabled? Does golangci-lint knows that gofumpt takes care of everything and so gofmt is redundant (and therefore does NOT execute it)? Or do we waste unnecessary resources because both of these formatters are executed? Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hello,
So if you enable both The formatters are run in a specific order to avoid conflicts:
If you are not using |
Beta Was this translation helpful? Give feedback.
-
|
I see. Thanks!
|
Beta Was this translation helpful? Give feedback.
Hello,
gofumptandgofmtare similar but different.gofmtgoimportsgofumptgcigoimportsis a "variant" ofgofmtwithoutsimplifyandrewrite-rulesbut withlocal-prefixesto organize imports.gofumptis a "variant" ofgoimportswithextra-rules, andmodule-pathis more limited thanlocal-prefixes.gciis a "variant" ofgoimportswith options to customize import orders.So if you enable both
gofumptandgofmt, both will be run.The formatters are run in a specific order to avoid conflicts:
gofmtgofumptg…