cannot define new methods on non-local type int

 

【GoLang】类型和作用在它上面定义的方法必须在同一个包里定义_golang

 

参考资料:

http://wiki.jikexueyuan.com/project/the-way-to-go/10.6.html

http://stackoverflow.com/questions/28800672/how-to-add-new-methods-to-an-existing-type-in-go