Repository: incubator-trafficcontrol Updated Branches: refs/heads/master 685ae989c -> d7cf76f42
Fix TO client broken Type(), User() Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/dd226346 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/dd226346 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/dd226346 Branch: refs/heads/master Commit: dd226346475f4f62614f3384a419c72e0756bc49 Parents: 7562358 Author: Robert Butts <robert.o.bu...@gmail.com> Authored: Mon Mar 27 14:16:05 2017 -0600 Committer: Dan Kirkwood <dang...@gmail.com> Committed: Thu Mar 30 10:34:14 2017 -0600 ---------------------------------------------------------------------- traffic_ops/client/type.go | 2 +- traffic_ops/client/user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dd226346/traffic_ops/client/type.go ---------------------------------------------------------------------- diff --git a/traffic_ops/client/type.go b/traffic_ops/client/type.go index 688c11d..6af4175 100644 --- a/traffic_ops/client/type.go +++ b/traffic_ops/client/type.go @@ -46,7 +46,7 @@ func (to *Session) Types(useInTable ...string) ([]Type, error) { if err != nil { return nil, err } - resp.Body.Close() + defer resp.Body.Close() var data TypeResponse if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dd226346/traffic_ops/client/user.go ---------------------------------------------------------------------- diff --git a/traffic_ops/client/user.go b/traffic_ops/client/user.go index 3534c77..1791938 100644 --- a/traffic_ops/client/user.go +++ b/traffic_ops/client/user.go @@ -45,7 +45,7 @@ func (to *Session) Users() ([]User, error) { if err != nil { return nil, err } - resp.Body.Close() + defer resp.Body.Close() var data UserResponse if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {