all: replace some cases of strings.SplitN with strings.Cut (#28446)

This commit is contained in:
Håvard Anda Estensen
2023-11-15 14:42:33 +01:00
committed by GitHub
parent db7895d3b6
commit a75a2d6db6
6 changed files with 20 additions and 22 deletions
+1 -3
View File
@@ -417,9 +417,7 @@ func rpcNode(ctx *cli.Context) error {
}
func rpcSubscribe(client *rpc.Client, out io.Writer, method string, args ...string) error {
parts := strings.SplitN(method, "_", 2)
namespace := parts[0]
method = parts[1]
namespace, method, _ := strings.Cut(method, "_")
ch := make(chan interface{})
subArgs := make([]interface{}, len(args)+1)
subArgs[0] = method