mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
rpc: return a slice of strings, simpler and equivalent
Signed-off-by: meows <b5c6@protonmail.com>
This commit is contained in:
parent
fb6453db1d
commit
9b8f5cc143
1 changed files with 2 additions and 4 deletions
|
|
@ -18,7 +18,6 @@ package rpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
)
|
)
|
||||||
|
|
@ -33,8 +32,7 @@ func mustAvailableModule(module string, apis []API) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Crit("invalid api module", "module", module, "available", func() string {
|
log.Crit("invalid api module", "module", module, "available", func() (available []string) {
|
||||||
available := []string{}
|
|
||||||
outer:
|
outer:
|
||||||
for _, api := range apis {
|
for _, api := range apis {
|
||||||
// Only include unique api names
|
// Only include unique api names
|
||||||
|
|
@ -45,7 +43,7 @@ func mustAvailableModule(module string, apis []API) {
|
||||||
}
|
}
|
||||||
available = append(available, api.Namespace)
|
available = append(available, api.Namespace)
|
||||||
}
|
}
|
||||||
return strings.Join(available, ",")
|
return
|
||||||
}())
|
}())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue