Skip to content

Commit 9ff31a5

Browse files
rscgopherbot
authored andcommitted
x/tools/go/analysis/passes/printf: revert URL in error message
Revert CL 422854, which added a URL to this one error message, shortly after the Go 1.19 release, which means there is still time to keep it from ending up in Go 1.20. % go test # runtime/metrics_test ./description_test.go:61:4: (*testing.common).Errorf format %s has arg samples[0].Value.Kind() of wrong type runtime/metrics.ValueKind, see also https://pkg.go.dev/fmt#hdr-Printing After this CL the ", see also" will not print. The URL is undoubtedly helpful in some cases, but it makes the error much longer and reduces the signal-to-noise ratio. It is also not clear why this one error deserves special treatment. We should have a general solution for getting users to details about the specific errors being printed, not URLs in every message. This reverts commit 88d981e. Change-Id: Ib49e1fae94ba837f432d8a65e38e657cfa522668 Reviewed-on: https://go-review.googlesource.com/c/tools/+/462438 TryBot-Result: Gopher Robot <[email protected]> gopls-CI: kokoro <[email protected]> Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Russ Cox <[email protected]>
1 parent 2fa6ca1 commit 9ff31a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/analysis/passes/printf/printf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ func okPrintfArg(pass *analysis.Pass, call *ast.CallExpr, state *formatState) (o
910910
if reason != "" {
911911
details = " (" + reason + ")"
912912
}
913-
pass.ReportRangef(call, "%s format %s has arg %s of wrong type %s%s, see also https://pkg.go.dev/fmt#hdr-Printing", state.name, state.format, analysisutil.Format(pass.Fset, arg), typeString, details)
913+
pass.ReportRangef(call, "%s format %s has arg %s of wrong type %s%s", state.name, state.format, analysisutil.Format(pass.Fset, arg), typeString, details)
914914
return false
915915
}
916916
if v.typ&argString != 0 && v.verb != 'T' && !bytes.Contains(state.flags, []byte{'#'}) {

0 commit comments

Comments
 (0)