Skip to content

Commit

Permalink
Fix staticcheck S1004 (#66)
Browse files Browse the repository at this point in the history
This commit replaces `bytes.Compare(existing, output) == 0` with `bytes.Equal(existing, output)`, to comply with https://staticcheck.dev/docs/checks/#S1004.
  • Loading branch information
k3forx authored Sep 5, 2023
1 parent 974b477 commit 7adc635
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mockgen/mockgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,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)
Expand Down

0 comments on commit 7adc635

Please sign in to comment.