just put defer resp.Body.Close() here. The check for non-nil resp is not necessary, since we can assume it's not nil if err was nil. If err != nil it's not necessary to close the body since there won't be one.

Other than that, the rest of the changeset looks good. Please fix this one thing then I'll merge.