Fix file descriptor leaks and add test

* Add response.Body.Close() where needed to release HTTP
  connections to API server.
* Add tests to ensure no general leaks occur. 100% coverage would be
  required to ensure no leaks on any call.
* Update code comments to be godoc correct

Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
Jhon Honce
2021-08-02 14:09:55 -07:00
committed by Matthew Heon
parent 4d244357a2
commit dda3e5b4e4
33 changed files with 360 additions and 35 deletions

View File

@ -28,5 +28,7 @@ func Commit(ctx context.Context, nameOrID string, options *CommitOptions) (handl
if err != nil {
return id, err
}
defer response.Body.Close()
return id, response.Process(&id)
}