diff --git a/model.go b/model.go index 9646baa..c249cda 100644 --- a/model.go +++ b/model.go @@ -24,10 +24,10 @@ type User struct { Avatar *FilePhoto `json:"avatar"` } -func ParseToUser(data interface{}, result User) (err error) { +func ParseToUser(data interface{}, result *User) (err error) { b := InterfaceToBytes(data) if len(b) > 0 { - err = json.Unmarshal(b, &result) + err = json.Unmarshal(b, result) } else { err = errors.New("[natsio.ParseUser] cannot read data") } @@ -56,10 +56,10 @@ type FileDimensions struct { Medium *FileSize `json:"md"` } -func ParseToPhoto(data interface{}, result FilePhoto) (err error) { +func ParseToPhoto(data interface{}, result *FilePhoto) (err error) { b := InterfaceToBytes(data) if len(b) > 0 { - err = json.Unmarshal(b, &result) + err = json.Unmarshal(b, result) } else { err = errors.New("[natsio.ParsePhoto] cannot read data") }