From b0374f570842d9bd584afbe7ce604ce3174c6f9a Mon Sep 17 00:00:00 2001 From: CMGS Date: Mon, 20 Dec 2021 16:19:47 +0800 Subject: [PATCH] clean up if else --- store/etcdv3/node.go | 3 +-- store/etcdv3/pod.go | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/store/etcdv3/node.go b/store/etcdv3/node.go index 75403ce64..1ae08ca3c 100644 --- a/store/etcdv3/node.go +++ b/store/etcdv3/node.go @@ -189,9 +189,8 @@ func (m *Mercury) makeClient(ctx context.Context, node *types.Node) (client engi log.Warnf(ctx, "[makeClient] Get key failed %v", err) } continue - } else { - data[i] = string(ev.Value) } + data[i] = string(ev.Value) } return enginefactory.GetEngine(ctx, m.config, node.Name, node.Endpoint, data[0], data[1], data[2]) diff --git a/store/etcdv3/pod.go b/store/etcdv3/pod.go index a13318584..16079057b 100644 --- a/store/etcdv3/pod.go +++ b/store/etcdv3/pod.go @@ -48,7 +48,8 @@ func (m *Mercury) RemovePod(ctx context.Context, podname string) error { resp, err := m.Delete(ctx, key) if err != nil { return err - } else if resp.Deleted != 1 { + } + if resp.Deleted != 1 { return types.NewDetailedErr(types.ErrPodNotFound, podname) } return nil