recover from panic situation: - reflect: call of reflect.Value.Elem on struct Value
golang报错
recover from panic situation: - reflect: call of reflect.Value.Elem on struct Value
原因是该传,指针的地方没传。
electronicBook := model.ElectronicBook{}
err = req.ReadEntity(&electronicBook)
if err != nil {
res.AddHeader("Content-Type","application/json")
res.WriteErrorString(http.StatusBadRequest,err.Error())
return
}
err = c.service.Insert(gliHeader.UserID,&electronicBook)