Fix NPE panic in ACI client

resp is nil when `Do()` has an error.

Also seems there was some gofmt issues in the file.
This commit is contained in:
Brian Goff
2018-09-19 18:15:35 -07:00
parent b8d0b6eb03
commit 74840defdf
2 changed files with 12 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ func (c *Client) GetContainerGroup(ctx context.Context, resourceGroup, container
// Send the request.
resp, err := c.hc.Do(req)
if err != nil {
return nil, fmt.Errorf("Sending get container group request failed: %v", err), &resp.StatusCode
return nil, fmt.Errorf("Sending get container group request failed: %v", err), nil
}
defer resp.Body.Close()