You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package pkg
func fn() {
var ch chan int
for range ch {
defer println()
break
}
for range ch {
defer println()
return
}
}
But they do get flagged:
/tmp/foo.go:6:3: defers in this range loop won't run unless the channel gets closed (SA9001)
/tmp/foo.go:11:3: defers in this range loop won't run unless the channel gets closed (SA9001)