Skip to content

Commit 39d7929

Browse files
ian-howelltpounds
authored andcommitted
Improve the error output from goimports
This causes goimports to provide additional information if the "local-prefixes" option has been set.
1 parent 92b472e commit 39d7929

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/golinters/gofmt_common.go

+3
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ func extractIssuesFromPatch(patch string, log logutils.Log, lintCtx *linter.Cont
229229
var text string
230230
if isGoimports {
231231
text = "File is not `goimports`-ed"
232+
if lintCtx.Settings().Goimports.LocalPrefixes != "" {
233+
text += " with -local " + lintCtx.Settings().Goimports.LocalPrefixes
234+
}
232235
} else {
233236
text = "File is not `gofmt`-ed"
234237
if lintCtx.Settings().Gofmt.Simplify {

0 commit comments

Comments
 (0)