19 lines
212 B
Go
19 lines
212 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
var i interface{}
|
|
describe(i)
|
|
|
|
i = 42
|
|
describe(i)
|
|
|
|
i = "hello"
|
|
describe(i)
|
|
}
|
|
|
|
func describe(i interface{}) {
|
|
fmt.Printf("(%v, %T)\n", i, i)
|
|
}
|