honnef.co/go/tools@v0.4.7/staticcheck/testdata/src/example.com/CheckEmptyBranch/CheckEmptyBranch.go (about) 1 package pkg 2 3 func fn1() { 4 if true { //@ diag(`empty branch`) 5 } 6 if true { //@ diag(`empty branch`) 7 } else { //@ diag(`empty branch`) 8 } 9 if true { 10 println() 11 } 12 13 if true { 14 println() 15 } else { //@ diag(`empty branch`) 16 } 17 18 if true { //@ diag(`empty branch`) 19 // TODO handle error 20 } 21 22 if true { 23 } else { 24 println() 25 } 26 27 if true { 28 } else if false { //@ diag(`empty branch`) 29 } 30 }