|
|
@@ -156,7 +156,7 @@ var interfaceSlice []interface{} = dataSlice
|
|
|
|
|
|
可惜不能这么做,编译时会出错:`cannot use dataSlice (type []myType) as type []interface { } in assignment`。
|
|
|
|
|
|
-原因是它们俩在内存中的布局是不一样的(参考 [官方说明](http://golang.org/doc/go_spec.html))。
|
|
|
+原因是它们俩在内存中的布局是不一样的(参考 [Go wiki](https://github.com/golang/go/wiki/InterfaceSlice))。
|
|
|
|
|
|
必须使用 `for-range` 语句来一个一个显式地复制:
|
|
|
|