type TCustomIntType int func aFunc() { var fails []TCustomIntType = []TCustomIntType([]int{}) }
我有:
cannot convert []int literal (type []int) to type []TCustomIntType
怎么解决?我是否必须手动编写转换功能?
是的,您必须使用for循环手动复制它。