diff options
| author | Alan Donovan <adonovan@google.com> | 2024-05-23 10:47:36 -0400 |
|---|---|---|
| committer | Alan Donovan <adonovan@google.com> | 2024-05-23 18:42:28 +0000 |
| commit | bf91eb3a8bb057a620f3823e4d6b74a529c0a44d (patch) | |
| tree | 4492b65fecf2d22336f43b63794296541d56209a /src/math | |
| parent | c34c124f4007e79978674ba519b9421665060186 (diff) | |
| download | go-bf91eb3a8bb057a620f3823e4d6b74a529c0a44d.tar.xz | |
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/math')
| -rw-r--r-- | src/math/big/int_test.go | 2 | ||||
| -rw-r--r-- | src/math/rand/rand_test.go | 2 | ||||
| -rw-r--r-- | src/math/rand/v2/rand_test.go | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/math/big/int_test.go b/src/math/big/int_test.go index 088bce09f9..f701652f1b 100644 --- a/src/math/big/int_test.go +++ b/src/math/big/int_test.go @@ -1909,7 +1909,7 @@ func TestFillBytes(t *testing.T) { "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", } { t.Run(n, func(t *testing.T) { - t.Logf(n) + t.Log(n) x, ok := new(Int).SetString(n, 0) if !ok { panic("invalid test entry") diff --git a/src/math/rand/rand_test.go b/src/math/rand/rand_test.go index 016cc69920..7906f29674 100644 --- a/src/math/rand/rand_test.go +++ b/src/math/rand/rand_test.go @@ -77,7 +77,7 @@ func checkSampleDistribution(t *testing.T, samples []float64, expected *statsRes actual := getStatsResults(samples) err := actual.checkSimilarDistribution(expected) if err != nil { - t.Errorf(err.Error()) + t.Error(err) } } diff --git a/src/math/rand/v2/rand_test.go b/src/math/rand/v2/rand_test.go index e89ee29f60..65049cf44d 100644 --- a/src/math/rand/v2/rand_test.go +++ b/src/math/rand/v2/rand_test.go @@ -74,7 +74,7 @@ func checkSampleDistribution(t *testing.T, samples []float64, expected *statsRes actual := getStatsResults(samples) err := actual.checkSimilarDistribution(expected) if err != nil { - t.Errorf(err.Error()) + t.Error(err) } } |
