当变量是nil:
package main
import "fmt"
func main() {
var a interface{}
fmt.Println(a)
b, ok := a.(int)
if !ok {
fmt.Println("sssss")
}
fmt.Println(b)
}
package main
import "fmt"
func main() {
var a interface{}
fmt.Println(a)
b := a.(int) //panic
fmt.Println(b)
}