2022年1月7日

Go 将interface转为int, string, slice, struct等类型

摘要: 在golang中,interface{}允许接纳任意值,int, string, struct,slice等,因此我可以很简单的将值传递到interface{} 但是当我们将任意类型传入到test函数中转为interface后,经常需要进行一系列操作interface不具备的方法(即传入的User结 阅读全文

posted @ 2022-01-07 10:21 星河赵 阅读(4685) 评论(0) 推荐(0) 编辑

导航