aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/csv
diff options
context:
space:
mode:
authorapocelipes <seve3r@outlook.com>2024-07-24 10:32:38 +0000
committerGopher Robot <gobot@golang.org>2024-07-25 00:23:58 +0000
commitb5b9d24dc38c63cca6319f2b139cb9b35b3cb058 (patch)
treeb7c62fd2f47432d0e281c3ecc0c291915658218d /src/encoding/csv
parent05861ff90cfc855620d0dcbd1d6cc488ebf04880 (diff)
downloadgo-b5b9d24dc38c63cca6319f2b139cb9b35b3cb058.tar.xz
encoding: use slices and maps to clean up tests
Replace reflect.DeepEqual with slices.Equal/maps.Equal, which is much faster. Change-Id: I62ad60a66e28cfb2bb49c36037bafd4b9d201e88 GitHub-Last-Rev: 79554baddb1856260a44ba6587c205d223a527b1 GitHub-Pull-Request: golang/go#67611 Reviewed-on: https://go-review.googlesource.com/c/go/+/587818 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: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/encoding/csv')
-rw-r--r--src/encoding/csv/reader_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/encoding/csv/reader_test.go b/src/encoding/csv/reader_test.go
index 2e5d62330c..0be236a52f 100644
--- a/src/encoding/csv/reader_test.go
+++ b/src/encoding/csv/reader_test.go
@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"reflect"
+ "slices"
"strings"
"testing"
"unicode/utf8"
@@ -470,7 +471,7 @@ func TestRead(t *testing.T) {
}
break
}
- if got, want := rec, tt.Output[recNum]; !reflect.DeepEqual(got, want) {
+ if got, want := rec, tt.Output[recNum]; !slices.Equal(got, want) {
t.Errorf("Read vs ReadAll mismatch;\ngot %q\nwant %q", got, want)
}
pos := positions[recNum]