gorm
gorm
、Edgar
Coding with fun
展开
-
Http状态码对应的状态
ValueDescription Reference 100Continue[RFC7231, Section 6.2.1]101Switching Protocols[RFC7231, Section 6.2.2]102Processing[RFC2518]103Early Hints[RFC8297]104-199Unassigned200OK[RFC7231, Section 6.3.1]201Created[RFC7231, Section 6.3.2]202Accepted[RFC7231, Se原创 2020-09-01 20:33:25 · 1433 阅读 · 0 评论 -
unsupported destination, should be slice or struct
某次如下使用gorm的时候出现以下的错误: DB.Model(&model.Captcha{}).Find(data) unsupported destination, should be slice or struct 其实之前我使用过一样的方式写过代码,当时请求的时候是正确的,不过这次就????,一言难尽 后来在stackoverflow上面问了这个问题,在这里总结一下 使用结构体接收数据 如果直接使用var data *structType 来定义变量接收数据,由于没有进行初始化,所以刚开原创 2020-08-23 13:01:09 · 4825 阅读 · 2 评论