From 9b8f5cc143ca131ab44afb7586aeb9e2d4002286 Mon Sep 17 00:00:00 2001 From: meows Date: Wed, 18 Dec 2019 09:05:06 -0600 Subject: [PATCH] rpc: return a slice of strings, simpler and equivalent Signed-off-by: meows --- rpc/endpoints.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpc/endpoints.go b/rpc/endpoints.go index f7813e60de..297ab50fd8 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -18,7 +18,6 @@ package rpc import ( "net" - "strings" "github.com/ethereum/go-ethereum/log" ) @@ -33,8 +32,7 @@ func mustAvailableModule(module string, apis []API) { return } } - log.Crit("invalid api module", "module", module, "available", func() string { - available := []string{} + log.Crit("invalid api module", "module", module, "available", func() (available []string) { outer: for _, api := range apis { // Only include unique api names @@ -45,7 +43,7 @@ func mustAvailableModule(module string, apis []API) { } available = append(available, api.Namespace) } - return strings.Join(available, ",") + return }()) }