github.com/serversong/goreporter@v0.0.0-20200325104552-3cfaf44fd178/linters/staticcheck/testdata/CheckInfiniteEmptyLoop.go (about) 1 package pkg 2 3 func fn2() bool { return true } 4 5 func fn() { 6 for { // MATCH /this loop will spin/ 7 } 8 9 for fn2() { 10 } 11 12 for { 13 break 14 } 15 16 for true { // MATCH "loop condition never changes" 17 } 18 } 19 20 // MATCH:16 "this loop will spin"