go-tour/nil-interface-values.go
2020-02-08 16:39:18 -06:00

18 lines
171 B
Go

package main
import "fmt"
type I interface {
M()
}
func main() {
var i I
describe(i)
i.M()
}
func describe(i I) {
fmt.Printf("(%v, %T)\n", i, i)
}