Use net.IP.Equal instead of bytes.Equal (#49)

As suggested by go-staticcheck.
This commit is contained in:
David E. Wheeler authored and GitHub committed 2023-11-06 14:32:46 +09:00
1 parent 06f9b47996
commit fc2f84a086
1 file changed
+1 -2
+1 -2
View File
@@ -1,7 +1,6 @@
package sonyflake package sonyflake
import ( import (
"bytes"
"errors" "errors"
"fmt" "fmt"
"net" "net"
@@ -259,7 +258,7 @@ func TestPrivateIPv4(t *testing.T) {
return return
} }
if bytes.Equal(actual, tc.expected) { if net.IP.Equal(actual, tc.expected) {
return return
} else { } else {
t.Errorf("error: expected: %s, but got: %s", tc.expected, actual) t.Errorf("error: expected: %s, but got: %s", tc.expected, actual)