]> Cypherpunks repositories - gostls13.git/commitdiff
time: fix FuzzFormatRFC3339 nano comparison
authorJorropo <jorropo.pgm@gmail.com>
Mon, 5 Feb 2024 00:22:58 +0000 (01:22 +0100)
committerGopher Robot <gobot@golang.org>
Thu, 8 Feb 2024 23:28:17 +0000 (23:28 +0000)
Change-Id: I13ed84b99459d5844abb6e932cc4b8e0bd3ae9f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/561215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/time/format_test.go

index 8a26eaa35bab10c25f5faf49ed72e22f61e256a4..29b9c280e6006aa720bab04824d7a779ea464281 100644 (file)
@@ -1001,7 +1001,7 @@ func FuzzFormatRFC3339(f *testing.F) {
 
                gotNanos := AppendFormatRFC3339(ts, nil, true)
                wantNanos := AppendFormatAny(ts, nil, RFC3339Nano)
-               if !bytes.Equal(got, want) {
+               if !bytes.Equal(gotNanos, wantNanos) {
                        t.Errorf("Format(%s, RFC3339Nano) mismatch:\n\tgot:  %s\n\twant: %s", ts, gotNanos, wantNanos)
                }
        })