From 638e16f2b05612b15970d18c6ab811a9aa0c31ff Mon Sep 17 00:00:00 2001 From: David Newhall II Date: Wed, 19 Jun 2019 00:40:25 -0700 Subject: [PATCH] less is more --- core/unifi/unifi.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/unifi/unifi.go b/core/unifi/unifi.go index 2324256f..c8db87d7 100644 --- a/core/unifi/unifi.go +++ b/core/unifi/unifi.go @@ -141,12 +141,12 @@ func (u *Unifi) GetSites() (Sites, error) { // GetData makes a unifi request and unmarshal the response into a provided pointer. func (u *Unifi) GetData(methodPath string, v interface{}) error { - if body, err := u.GetJSON(methodPath); err != nil { + body, err := u.GetJSON(methodPath) + if err != nil { return err - } else if err = json.Unmarshal(body, v); err != nil { - return errors.Wrapf(err, "json.Unmarshal(%s)", methodPath) } - return nil + err = json.Unmarshal(body, v) + return errors.Wrapf(err, "json.Unmarshal(%s)", methodPath) } // UniReq is a small helper function that adds an Accept header.