etcd: modify declaring empty slices

declare an empty slice to var s []int replace  s :=[]int{}, https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices

Signed-off-by: demoManito <1430482733@qq.com>
This commit is contained in:
demoManito
2022-09-16 14:30:00 +08:00
parent b7ba0542f6
commit 72cf0cc04a
55 changed files with 106 additions and 104 deletions

View File

@@ -96,7 +96,7 @@ func (tp *TCPProxy) Run() error {
tp.remotes = append(tp.remotes, &remote{srv: srv, addr: addr})
}
eps := []string{}
var eps []string
for _, ep := range tp.Endpoints {
eps = append(eps, fmt.Sprintf("%s:%d", ep.Target, ep.Port))
}