Improve the error output from goimports

This causes goimports to provide additional information if the
"local-prefixes" option has been set.
This commit is contained in:
Ian Howell 2019-10-02 15:31:44 -05:00 committed by Trevor Pounds
parent 92b472e8bc
commit 39d7929d61

View File

@ -229,6 +229,9 @@ func extractIssuesFromPatch(patch string, log logutils.Log, lintCtx *linter.Cont
var text string
if isGoimports {
text = "File is not `goimports`-ed"
if lintCtx.Settings().Goimports.LocalPrefixes != "" {
text += " with -local " + lintCtx.Settings().Goimports.LocalPrefixes
}
} else {
text = "File is not `gofmt`-ed"
if lintCtx.Settings().Gofmt.Simplify {