package
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Aug 11, 2020
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
pointer method可以修改对象的值,而value method不会,
所以如果在一个value对象上调用pointer method,编译器会对原来的值做一份拷贝,
并在拷贝后的值上执行函数,如果函数有修改原receiver的值,则修改的行为都发生在拷贝的值上,而不会影响原值,
这个错误很隐蔽,非常不容易调试发现,因此GO决定放弃这个错误的发生的可能性,
直接不支持pointer method被value对象调用。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.