From ea57654e34353b46f0b2725c9734891f1574c4d4 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 21 Jan 2022 00:16:50 -0800 Subject: [PATCH] refactoring --- weed/shell/command_collection_list.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/shell/command_collection_list.go b/weed/shell/command_collection_list.go index b2aa6d2f4..bc9f115bd 100644 --- a/weed/shell/command_collection_list.go +++ b/weed/shell/command_collection_list.go @@ -45,7 +45,7 @@ func (c *commandCollectionList) Do(args []string, commandEnv *CommandEnv, writer collectionInfos := make(map[string]*CollectionInfo) - writeCollectionInfo(writer, topologyInfo, collectionInfos) + collectCollectionInfo(topologyInfo, collectionInfos) for _, c := range collections { cif, found := collectionInfos[c] @@ -92,7 +92,7 @@ func addToCollection(collectionInfos map[string]*CollectionInfo, vif *master_pb. cif.VolumeCount++ } -func writeCollectionInfo(writer io.Writer, t *master_pb.TopologyInfo, collectionInfos map[string]*CollectionInfo) { +func collectCollectionInfo(t *master_pb.TopologyInfo, collectionInfos map[string]*CollectionInfo) { for _, dc := range t.DataCenterInfos { for _, r := range dc.RackInfos { for _, dn := range r.DataNodeInfos {