如题,试过index不过不好用,有空指针就更麻烦了。
使用断言
switch t:= xxx.(type){
case int:
....
case *structName:
....
}
如题,试过index不过不好用,有空指针就更麻烦了。
使用断言
switch t:= xxx.(type){
case int:
....
case *structName:
....
}