Files
LearnGO/go/pkg/mod/github.com/go-delve/delve@v1.23.0/_fixtures/genericintoiface.go
T
2024-09-19 21:38:24 -04:00

26 lines
235 B
Go

package main
import "fmt"
type Blah[T any] struct {
x T
}
func (b *Blah[T]) F(y T) {
b.x = y
}
type BlahInt interface {
F(int)
}
func callf(b BlahInt) {
b.F(2)
fmt.Println(b)
}
func main() {
b := &Blah[int]{10}
callf(b)
}