首页 > go语言template中如何取map[int] interface{}中的interface其中的属性?

go语言template中如何取map[int] interface{}中的interface其中的属性?

如题,试过index不过不好用,有空指针就更麻烦了。


使用断言

switch t:= xxx.(type){
    case int:
        ....
    case *structName:
        ....
}
【热门文章】
【热门文章】