github.com/serversong/goreporter@v0.0.0-20200325104552-3cfaf44fd178/linters/staticcheck/testdata/CheckSillyBitwiseOps.go (about)

     1  package pkg
     2  
     3  func fn(x int) {
     4  	println(x | 0)        // MATCH "x | 0 always equals x"
     5  	println(x & 0)        // MATCH "x & 0 always equals 0"
     6  	println(x ^ 0)        // MATCH "x ^ 0 always equals x"
     7  	println((x << 5) | 0) // MATCH "x | 0 always equals x"
     8  	println(x | 1)
     9  	println(x << 0)
    10  }