github.com/serversong/goreporter@v0.0.0-20200325104552-3cfaf44fd178/linters/staticcheck/testdata/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) // MATCH /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  }