Open feikeq opened 1 month ago
注意这里我只是用UID做bug演示,实际使用中我会把数据库连接和配置文件还有控件器相关models在controllers控制器初始化时赋值给 type ContactController struct 结构体上。万分感谢!
This problem is caused by this
if structFieldIgnored(f) { continue // re-check here for ignored struct fields so we don't include them on dependencies. Non-zeroes fields can be static, even if they are functions. }
Thank you for your answer. How should I write it correctly now?
我在使用go语言的 Iris v12.2.5 框架做项目,为什么当访问 192.168.172.88:8080/contact 时初始化变量UID被清空了? 我的main.go代码如下:
12.2.4 get() UID: 123456 12.2.5 get() UID: 0 请帮我找出问题到底在哪?为什么 Iris 12.2.4 就不会有问题UID都有值,而到 12.2.5 版本下 ContactController 的UID就空值了 ?