cannot convert t (type interface {}) to type string: need type assertion

问题: 在使用interface表示任何类型时,若是要将interface转为某一类型,直接强制转换是不行的,例如:golang var t interface{} = "abc" s := string(t) cannot convert t(type interface {}) to type string: need type assertionweb 这样是不行的,须要进行type as
相关文章
相关标签/搜索