github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/staticcheck/sa1021/testdata/src/example.com/CheckBytesEqualIP/CheckBytesEqualIP.go (about)

     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  }