diff --git a/model.go b/model.go index e102f0f..beabd55 100644 --- a/model.go +++ b/model.go @@ -26,8 +26,8 @@ type User struct { Avatar *FilePhoto `json:"avatar"` } -func ParseUser(user User, result interface{}) (err error) { - b := InterfaceToBytes(user) +func ParseToUser(data interface{}, result User) (err error) { + b := InterfaceToBytes(data) if len(b) > 0 { err = json.Unmarshal(b, &result) } else { @@ -58,8 +58,8 @@ type FileDimensions struct { Medium *FileSize `json:"md"` } -func ParsePhoto(photo FilePhoto, result interface{}) (err error) { - b := InterfaceToBytes(photo) +func ParseToPhoto(data interface{}, result FilePhoto) (err error) { + b := InterfaceToBytes(data) if len(b) > 0 { err = json.Unmarshal(b, &result) } else {