Merge pull request #29935 from yuexiao-wang/fix-return

Remove redundant return nil
This commit is contained in:
Sebastiaan van Stijn 2017-01-06 13:59:44 +01:00 committed by GitHub
commit 1df474a311

View file

@ -1072,10 +1072,8 @@ func (c *Cluster) RemoveService(input string) error {
return err
}
if _, err := state.controlClient.RemoveService(ctx, &swarmapi.RemoveServiceRequest{ServiceID: service.ID}); err != nil {
return err
}
return nil
_, err = state.controlClient.RemoveService(ctx, &swarmapi.RemoveServiceRequest{ServiceID: service.ID})
return err
}
// ServiceLogs collects service logs and writes them back to `config.OutStream`
@ -1268,10 +1266,8 @@ func (c *Cluster) RemoveNode(input string, force bool) error {
return err
}
if _, err := state.controlClient.RemoveNode(ctx, &swarmapi.RemoveNodeRequest{NodeID: node.ID, Force: force}); err != nil {
return err
}
return nil
_, err = state.controlClient.RemoveNode(ctx, &swarmapi.RemoveNodeRequest{NodeID: node.ID, Force: force})
return err
}
// GetTasks returns a list of tasks matching the filter options.
@ -1594,10 +1590,8 @@ func (c *Cluster) RemoveNetwork(input string) error {
return err
}
if _, err := state.controlClient.RemoveNetwork(ctx, &swarmapi.RemoveNetworkRequest{NetworkID: network.ID}); err != nil {
return err
}
return nil
_, err = state.controlClient.RemoveNetwork(ctx, &swarmapi.RemoveNetworkRequest{NetworkID: network.ID})
return err
}
func (c *Cluster) populateNetworkID(ctx context.Context, client swarmapi.ControlClient, s *types.ServiceSpec) error {