diff --git a/internal/lsp/source/diagnostics.go b/internal/lsp/source/diagnostics.go index 9e35cb39a7..6c76670c86 100644 --- a/internal/lsp/source/diagnostics.go +++ b/internal/lsp/source/diagnostics.go @@ -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, }) }) diff --git a/internal/lsp/testdata/analyzer/bad_test.go b/internal/lsp/testdata/analyzer/bad_test.go index d10ff813c7..823eeca470 100644 --- a/internal/lsp/testdata/analyzer/bad_test.go +++ b/internal/lsp/testdata/analyzer/bad_test.go @@ -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{}) {