From e0ba596c15dd82aad021c0c812fda6ca14ce118a Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Thu, 7 Mar 2024 01:57:07 +0000 Subject: [PATCH] cmd/link: replace bytes.Compare call with bytes.Equal Change-Id: Icc254cad3c861fd2b33228aa4d19424ce57a1b55 GitHub-Last-Rev: f557a696e4a5c632c49c7cd20745eeb771708f81 GitHub-Pull-Request: golang/go#66153 Reviewed-on: https://go-review.googlesource.com/c/go/+/569695 Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Mauri de Souza Meneguzzo Reviewed-by: Michael Knyszek LUCI-TryBot-Result: Go LUCI --- src/cmd/link/internal/loader/loader_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/link/internal/loader/loader_test.go b/src/cmd/link/internal/loader/loader_test.go index 32ff2586cebfb..eedcc9876b8a7 100644 --- a/src/cmd/link/internal/loader/loader_test.go +++ b/src/cmd/link/internal/loader/loader_test.go @@ -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)) }