From bf91eb3a8bb057a620f3823e4d6b74a529c0a44d Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Thu, 23 May 2024 10:47:36 -0400 Subject: std: fix calls to Printf(s) with non-constant s In all cases the intent was not to interpret s as a format string. In one case (go/types), this was a latent bug in production. (These were uncovered by a new check in vet's printf analyzer.) Updates #60529 Change-Id: I3e17af7e589be9aec1580783a1b1011c52ec494b Reviewed-on: https://go-review.googlesource.com/c/go/+/587855 LUCI-TryBot-Result: Go LUCI Reviewed-by: Russ Cox --- src/database/sql/sql_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/database/sql/sql_test.go') diff --git a/src/database/sql/sql_test.go b/src/database/sql/sql_test.go index 7dfc6434e0..ff65e877a5 100644 --- a/src/database/sql/sql_test.go +++ b/src/database/sql/sql_test.go @@ -1753,7 +1753,7 @@ func TestIssue6651(t *testing.T) { want := "error in rows.Next" rowsCursorNextHook = func(dest []driver.Value) error { - return fmt.Errorf(want) + return errors.New(want) } defer func() { rowsCursorNextHook = nil }() @@ -1765,7 +1765,7 @@ func TestIssue6651(t *testing.T) { want = "error in rows.Close" setRowsCloseHook(func(rows *Rows, err *error) { - *err = fmt.Errorf(want) + *err = errors.New(want) }) defer setRowsCloseHook(nil) err = db.QueryRow("SELECT|people|name|").Scan(&v) -- cgit v1.3