Debian Codegraph @

staticcheck/sa1021/testdata/go1.0/CheckBytesEqualIP/CheckBytesEqualIP.go

raw
1 package pkg
2
3 import (
4 "bytes"
5 "net"
6 )
7
8 func fn() {
9 type T []byte
10 var i1, i2 net.IP
11 var b1, b2 []byte
12 var t1, t2 T
13
14 bytes.Equal(i1, i2) //@ diag(`use net.IP.Equal to compare net.IPs, not bytes.Equal`)
15 bytes.Equal(b1, b2)
16 bytes.Equal(t1, t2)
17
18 bytes.Equal(i1, b1)
19 bytes.Equal(b1, i1)
20 }