go-tour/nil-interface-values.go

18 lines
171 B
Go
Raw Permalink Normal View History

2020-02-08 22:39:18 +00:00
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)
}