mirror of https://github.com/docker/cli.git
remove redundant code and better error msg
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
a8f833a646
commit
bb22446a68
|
@ -8,10 +8,6 @@ import (
|
|||
// SwarmUnlock unlockes locked swarm.
|
||||
func (cli *Client) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error {
|
||||
serverResp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ensureReaderClosed(serverResp)
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ func (cli *Client) VolumesPrune(ctx context.Context, pruneFilters filters.Args)
|
|||
defer ensureReaderClosed(serverResp)
|
||||
|
||||
if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil {
|
||||
return report, fmt.Errorf("Error retrieving disk usage: %v", err)
|
||||
return report, fmt.Errorf("Error retrieving volume prune report:: %v", err)
|
||||
}
|
||||
|
||||
return report, nil
|
||||
|
|
Loading…
Reference in New Issue