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