From 18d468375d870965a596fe2fa0834525c3ddfd75 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 4 Oct 2022 22:47:40 +0800 Subject: [PATCH] mockgen: replace bytes.Compare with bytes.Equal Signed-off-by: cui fliter --- mockgen/mockgen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mockgen/mockgen.go b/mockgen/mockgen.go index 79cb921c..e2fee599 100644 --- a/mockgen/mockgen.go +++ b/mockgen/mockgen.go @@ -169,7 +169,7 @@ func main() { if err != nil && !errors.Is(err, os.ErrNotExist) { log.Fatalf("Failed reading pre-exiting destination file: %v", err) } - if len(existing) == len(output) && bytes.Compare(existing, output) == 0 { + if len(existing) == len(output) && bytes.Equal(existing, output) { return } f, err := os.Create(*destination)