Steps to reproduce
func TestAvoidChannelLenCheckNoChangeSlice(t *testing.T) {
spec := test.NewRecipeSpec().WithRecipe(&simplification.AvoidChannelLenCheck{})
spec.RewriteRun(t,
test.Golang(`
package main
func f(s []int) bool {
return len(s) == 0
}
`),
)
}
as in avoid_channel_len_check_test.go
Expected
No marker attached.
Observed
return/*~~(channel length check is racy; the value can change between check and send/receive)~~>*/ len(s) == 0
Steps to reproduce
as in
avoid_channel_len_check_test.goExpected
No marker attached.
Observed