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

cannot define new methods on non-local type int

 

 

参考资料:

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

 

posted @ 2016-12-21 19:01  junneyang  阅读(1006)  评论(0编辑  收藏  举报