Add code
This commit is contained in:
parent
0c63b698be
commit
6a315ca521
|
@ -0,0 +1,2 @@
|
||||||
|
all:
|
||||||
|
go run main.go
|
|
@ -0,0 +1,18 @@
|
||||||
|
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)
|
||||||
|
}
|
Reference in New Issue