1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:04:46 -07:00

internal/lsp: fix badly formatted error messages from go vet

Fixes golang/go#31494

Change-Id: Id65e0daaa67a9fe955b7586af82e4433762cd56c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/172398
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
Rebecca Stambler 2019-04-16 15:03:58 -04:00
parent b8fc0e1722
commit 76038274be
2 changed files with 2 additions and 3 deletions

View File

@ -112,11 +112,10 @@ func Diagnostics(ctx context.Context, v View, uri span.URI) (map[span.URI][]Diag
if diag.Category != "" {
category += "." + category
}
reports[s.URI()] = append(reports[s.URI()], Diagnostic{
Source: category,
Span: s,
Message: fmt.Sprintf(diag.Message),
Message: diag.Message,
Severity: SeverityWarning,
})
})

View File

@ -10,7 +10,7 @@ func Testbad(t *testing.T) { //@diag("", "tests", "Testbad has malformed name: f
var x sync.Mutex
_ = x //@diag("x", "copylocks", "assignment copies lock value to _: sync.Mutex")
printfWrapper("%s") //@diag("printfWrapper", "printf", "printfWrapper format %!s(MISSING) reads arg #1, but call has 0 args")
printfWrapper("%s") //@diag("printfWrapper", "printf", "printfWrapper format %s reads arg #1, but call has 0 args")
}
func printfWrapper(format string, args ...interface{}) {