github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/staticcheck/sa4013/testdata/src/example.com/CheckDoubleNegation/CheckDoubleNegation.go (about) 1 package pkg 2 3 func fn(b1, b2 bool) { 4 if !!b1 { //@ diag(`negating a boolean twice`) 5 println() 6 } 7 8 if b1 && !!b2 { //@ diag(`negating a boolean twice`) 9 println() 10 } 11 12 if !(!b1) { //@ diag(`negating a boolean twice`) 13 println() 14 } 15 16 if !b1 { 17 println() 18 } 19 20 if !b1 && !b2 { 21 println() 22 } 23 }