From 8630f77e4085001fb4c1c8777f0b3704c7c083ee Mon Sep 17 00:00:00 2001 From: secwall Date: Wed, 18 Feb 2026 08:03:51 +0100 Subject: [PATCH] Modernize GetState with go fix --- internal/valkey/node.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/valkey/node.go b/internal/valkey/node.go index 6a288ca..cae58cf 100644 --- a/internal/valkey/node.go +++ b/internal/valkey/node.go @@ -495,11 +495,11 @@ func (n *Node) GetState(ctx context.Context) (map[string]string, int64, bool, bo } pair := inp[pos : pos+endIndex] pos += endIndex + 2 - sepIndex := strings.Index(pair, ":") - if sepIndex == -1 { + before, after, ok := strings.Cut(pair, ":") + if !ok { continue } - res[pair[:sepIndex]] = pair[sepIndex+1:] + res[before] = after } n.infoResults = append(n.infoResults, true) if len(n.infoResults) > n.config.PingStable {