2020
12-24
12-24
解决golang json解析出现值为空的问题
我是通过beego框架,将请求过来的json进行解析,并将值保存在结构体中--------------------1---------------------request:=UpdateCommentRequestData{}req:=common.Request{Data:request}err:=json.Unmarshal(controller.Ctx.Input.RequestBody,&req)------------------------------------------其中UpdateCommentRequestData的结构是这样的typeUpdateCommentRequestDatastruct{Id[]string`json:"id"`}common.r...
继续阅读 >