hi i'm new to gin framework and golang and i was wondering what's the difference between Json.Unmarshal() and gin.BindJson()
in the tutorial he's building a video service which has two methods, save and findall
func (vc *videoControllerStruct) Save(ctx *gin.Context) entity.Video {
video := entity.Video{}
ctx.ShouldBind(&video) // ctx.BindJson(&video)
vc.services.Save(video)
return video
as you can see he used ctx.BindJson first and then changed it to ShouldBind (idk why) is there a way to re-write this code with json.unmarshal?