mirror of
https://gitee.com/johng/gf
synced 2026-07-05 13:22:16 +08:00
17 lines
199 B
Go
17 lines
199 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type T struct{
|
|
name string
|
|
}
|
|
func main() {
|
|
var i interface{} = T{"john"}
|
|
switch v := i.(type) {
|
|
case T:
|
|
default:
|
|
fmt.Println(v)
|
|
}
|
|
} |