From ba99c7dc036254b167f57a2b4585ef8dc0dde916 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Tue, 8 Feb 2022 16:02:47 +0800 Subject: [PATCH] :bug: fix multiple accounts with the same prefix cannot be load balanced --- model/account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/account.go b/model/account.go index 27e83418..aea51136 100644 --- a/model/account.go +++ b/model/account.go @@ -108,7 +108,7 @@ func GetAccount(name string) (Account, bool) { func GetAccountsByName(name string) []Account { accounts := make([]Account, 0) for _, v := range accountsMap { - if v.Name == name || (strings.HasSuffix(v.Name, balance) && strings.HasPrefix(v.Name, name)) { + if v.Name == name || v.Name == name+balance { accounts = append(accounts, v) } }