From 39d7929d611d57a80c13ecd6c89baf98499af40c Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Wed, 2 Oct 2019 15:31:44 -0500 Subject: [PATCH] Improve the error output from goimports This causes goimports to provide additional information if the "local-prefixes" option has been set. --- pkg/golinters/gofmt_common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/golinters/gofmt_common.go b/pkg/golinters/gofmt_common.go index 6f4e7dd7..dd740d2f 100644 --- a/pkg/golinters/gofmt_common.go +++ b/pkg/golinters/gofmt_common.go @@ -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 {