Debian Codegraph @

staticcheck/sa6003/testdata/go1.18/CheckRangeStringRunes/generics.go

raw
1 package pkg
2
3 func tpfn1[T string](x T) {
4 for _, c := range []rune(x) { //@ diag(`should range over string`)
5 println(c)
6 }
7 }
8
9 func tpfn2[T1 string, T2 []rune](x T1) {
10 for _, c := range T2(x) { //@ diag(`should range over string`)
11 println(c)
12 }
13 }