Varus Hsu

Results 8 comments of Varus Hsu

To use `ShouldBind()`, you should special "content-type:application/json" on your http request headers. This is my code: ``` package main import ( "net/http" "github.com/gin-gonic/gin" "gorm.io/gorm" ) type ActuatorDeviceInfo struct { gorm.Model...

By the way, The field with the tag `binding:"required"` must be provide in your json.Otherwise,ShouldBind will throw error. So in your case, I guess may you didn't special 'content-type' :)

This is comment of ShouldBind https://github.com/gin-gonic/gin/blob/c2ba8f19ec19914b73290c53a32de479cd463555/context.go#L685

``` package main import ( "net/http" "github.com/gin-gonic/gin" ) func main() { g := gin.Default() g.POST("/hello", func(c *gin.Context) { var body TestBody err := c.ShouldBind(&body) if err != nil { c.Status(http.StatusBadRequest)...

pr link see: https://github.com/go-gorm/gorm/pull/7004

Sqlingo not support well to postgres many complex type so far. It's still in experimental stage. But welcome giving more ideas or advises. @veqryn

The `slices` package was moved from the experimental library to the standard library in go version 1.21. You can upgrade go version later than 1.21 or downgrade gin version.

It's seem that upgrade go version is a better way.