关于类型转换

glowwormX · · 745 次点击
问题能描述清楚点么 或者参考语法规范 ··· A non-constant value x can be converted to type T in any of these cases: x is assignable to T. ignoring struct tags (see below), x's type and T have identical underlying types. ignoring struct tags (see below), x's type and T are pointer types that are not defined types, and their pointer base types have identical underlying types. x's type and T are both integer or floating point types. x's type and T are both complex types. x is an integer or a slice of bytes or runes and T is a string type. x is a string and T is a slice of bytes or runes. ···
#2
更多评论
感觉没办法转换呀,,, 转换的前提是两种类型兼容. slice 和 map 没办法相互转吧. 你找到方法了吗, 学习一下
#1