1
0
mirror of https://github.com/golang/go synced 2024-11-11 19:01:37 -07:00

cmd/link: replace bytes.Compare call with bytes.Equal

Change-Id: Icc254cad3c861fd2b33228aa4d19424ce57a1b55
GitHub-Last-Rev: f557a696e4
GitHub-Pull-Request: golang/go#66153
Reviewed-on: https://go-review.googlesource.com/c/go/+/569695
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
guoguangwu 2024-03-07 01:57:07 +00:00 committed by Gopher Robot
parent 47079b5e80
commit e0ba596c15

View File

@ -192,7 +192,7 @@ func TestAddMaterializedSymbol(t *testing.T) {
// ... then data.
dat := sb2.Data()
if bytes.Compare(dat, d2) != 0 {
if !bytes.Equal(dat, d2) {
t.Errorf("expected es2 data %v, got %v", d2, dat)
}
@ -362,7 +362,7 @@ func TestAddDataMethods(t *testing.T) {
t.Errorf("testing Loader.%s: expected kind %s got %s",
tp.which, tp.expKind, ldr.SymType(mi))
}
if bytes.Compare(ldr.Data(mi), tp.expData) != 0 {
if !bytes.Equal(ldr.Data(mi), tp.expData) {
t.Errorf("testing Loader.%s: expected data %v got %v",
tp.which, tp.expData, ldr.Data(mi))
}