![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
golang
golang编程相关经验总结
yipie
开朗活泼
展开
-
golang的接口的指针接收者和非指针接收者的区别(notify method has pointer receiver)
在Golang中第一次使用interface 遇到了一个有意思的问题: cannot use serialServiceEntity (type serialService) as type service in assignment: serialService does not implement service (Close method has pointer receiver) 1 这个...原创 2020-02-22 00:34:08 · 2074 阅读 · 3 评论 -
golang-gorm-belong
属于(belongs to)关联建立与另一模型的一对一连接,使得声明模型的每个实例“属于”另一模型的一个实例。 例如,如果您的应用程序包含用户和配置文件,则每个配置文件只能分配给一个用户。 Profile 属于 User, User 是 Profile 的所有者。 定义模型: type User struct { gorm.Model Name string } // Profil...转载 2020-02-13 10:42:01 · 335 阅读 · 0 评论