Source file tour/methods/nil-interface-values.go

     1  //go:build norun || OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  type I interface {
     8  	M()
     9  }
    10  
    11  func main() {
    12  	var i I
    13  	describe(i)
    14  	i.M()
    15  }
    16  
    17  func describe(i I) {
    18  	fmt.Printf("(%v, %T)\n", i, i)
    19  }
    20  

View as plain text