honnef.co/go/tools@v0.5.0-0.dev.0.20240520180541-dcae280a5e87/simple/s1018/testdata/src/example.com/CheckLoopSlide/generics.go (about) 1 //go:build go1.18 2 3 package pkg 4 5 func tpfn[T []int]() { 6 var n int 7 var bs T 8 var offset int 9 10 for i := 0; i < n; i++ { //@ diag(`should use copy() instead of loop for sliding slice elements`) 11 bs[i] = bs[offset+i] 12 } 13 }