fix: check err

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2019-01-07 22:08:15 +00:00
parent 726ecb0812
commit 7beb0cde18

View File

@ -72,10 +72,9 @@ database.`,
func getAuther(sample auth.Auther, data interface{}) interface{} { func getAuther(sample auth.Auther, data interface{}) interface{} {
authType := reflect.TypeOf(sample) authType := reflect.TypeOf(sample)
auther := reflect.New(authType).Interface() auther := reflect.New(authType).Interface()
bytes, err := json.Marshal(data) bytes, err := json.Marshal(data)
checkErr(err) checkErr(err)
err = json.Unmarshal(bytes, &auther) err = json.Unmarshal(bytes, &auther)
checkErr(err)
return auther return auther
} }