On Fri, Nov 9, 2018 at 6:35 AM <ge.sf....@gmail.com> wrote: > > front-end info > //body struct > type Bucket struct { > Name string `json:"name"` > KeyId string `json:"key_id"` > KeySecret string `json:"key_secret"` > Header *Header `json:"header"` > Property int `json:"property"` > } > > type Header struct { > CacheControl int64 `json:"cache_control"` > } > //my post request body > {"name":"g","key_id":"221bce6492eba70f","key_secret":"6eb80603e85842542f9736eb13b7e3","header":{"cache_control":"10"},"property":"0"}
"cache_control":"10" is a string. If you want to unmarshal an int, this should've been "cache_control":10 (without the quotes) Or, change the Header.CacheControl to string. > > Name > front-end > back-end error when do > /usr/local/Cellar/go/1.10.3/libexec/src/encoding/json/decode.go:171 > cache_control is string not int > > > > > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.