在 gob 使用示例http://golang.org/src/encoding/gob/example_interface_test.go 中,他們提供了以下論文: Pass pointer to interface so Encode sees (and hence sends) a value of interface type. If we passed p directly it would see the concrete type instead. See the blog post, "The Laws of Reflection" for background.我已經(jīng)閱讀了兩次反射定律,以及一篇相關的 Russ Cox 文章。但是我在那里找不到指針到接口和接口之間的區(qū)別。那么為什么通過指針它看到接口類型的值,而沒有指針它看到(對我來說很驚訝)具體類型?
- 1 回答
- 0 關注
- 177 瀏覽
添加回答
舉報
0/150
提交
取消