shad-go/lectures/08-generics/skip/skip.go

18 lines
185 B
Go
Raw Normal View History

2023-04-01 21:02:32 +00:00
package main
import "fmt"
func F[T ~[]T](t T) T {
return t[1][3][3][7][6][6][6]
}
type G []G
func main() {
g := make(G, 10)
for i := range g {
g[i] = g
}
fmt.Println(F(g))
}