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:
parent
b8fc0e1722
commit
76038274be
|
@ -112,11 +112,10 @@ func Diagnostics(ctx context.Context, v View, uri span.URI) (map[span.URI][]Diag
|
||||||
if diag.Category != "" {
|
if diag.Category != "" {
|
||||||
category += "." + category
|
category += "." + category
|
||||||
}
|
}
|
||||||
|
|
||||||
reports[s.URI()] = append(reports[s.URI()], Diagnostic{
|
reports[s.URI()] = append(reports[s.URI()], Diagnostic{
|
||||||
Source: category,
|
Source: category,
|
||||||
Span: s,
|
Span: s,
|
||||||
Message: fmt.Sprintf(diag.Message),
|
Message: diag.Message,
|
||||||
Severity: SeverityWarning,
|
Severity: SeverityWarning,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -10,7 +10,7 @@ func Testbad(t *testing.T) { //@diag("", "tests", "Testbad has malformed name: f
|
||||||
var x sync.Mutex
|
var x sync.Mutex
|
||||||
_ = x //@diag("x", "copylocks", "assignment copies lock value to _: 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{}) {
|
func printfWrapper(format string, args ...interface{}) {
|
||||||
|
|
Loading…
Reference in New Issue