github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/staticcheck/testdata/src/CheckDoubleNegation/CheckDoubleNegation.go (about) 1 package pkg 2 3 func fn(b1, b2 bool) { 4 if !!b1 { // MATCH /negating a boolean twice/ 5 println() 6 } 7 8 if b1 && !!b2 { // MATCH /negating a boolean twice/ 9 println() 10 } 11 12 if !(!b1) { // doesn't match, maybe it should 13 println() 14 } 15 16 if !b1 { 17 println() 18 } 19 20 if !b1 && !b2 { 21 println() 22 } 23 }