From daca2d22a56fb1ff6d659fe8dda2c5d3d0c65a15 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 1 Apr 2022 17:34:42 -0700 Subject: [PATCH] use original server address string as map key --- weed/command/master.go | 2 +- weed/pb/server_address.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/command/master.go b/weed/command/master.go index e56ee19fe..3d69f4216 100644 --- a/weed/command/master.go +++ b/weed/command/master.go @@ -134,7 +134,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) { masterPeers := make(map[string]pb.ServerAddress) for _, peer := range peers { - masterPeers[peer.String()] = peer + masterPeers[string(peer)] = peer } r := mux.NewRouter() diff --git a/weed/pb/server_address.go b/weed/pb/server_address.go index c7faea4bd..a66d0d831 100644 --- a/weed/pb/server_address.go +++ b/weed/pb/server_address.go @@ -89,7 +89,7 @@ func (sa ServerAddresses) ToAddresses() (addresses []ServerAddress) { func (sa ServerAddresses) ToAddressMap() (addresses map[string]ServerAddress) { addresses = make(map[string]ServerAddress) for _, address := range sa.ToAddresses() { - addresses[address.String()] = address + addresses[string(address)] = address } return }