Fixes #60500.
Change-Id: I272c71071f239d5c9472e19ae25461001e7f6a8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/499275
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
}
func (check *Checker) error(at positioner, code Code, msg string) {
- check.report(newErrorf(at, code, msg))
+ check.report(newErrorf(at, code, "%s", msg))
}
func (check *Checker) errorf(at positioner, code Code, format string, args ...any) {
--- /dev/null
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+func _() {
+ log("This is a test %v" /* ERROR "cannot use \"This is a test %v\" (untyped string constant) as bool value in argument to log" */, "foo")
+}
+
+func log(enabled bool, format string, args ...any)