From c87dd522d8006535b8acf6a97a5ba00e2e617344 Mon Sep 17 00:00:00 2001 From: Segun Adebayo Date: Sat, 15 Jul 2023 14:20:59 +0100 Subject: [PATCH] Update string.go fix for panic error while using the jamctl get command. --- pkg/util/string.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/util/string.go b/pkg/util/string.go index 6c5a6cc..8e0fc22 100644 --- a/pkg/util/string.go +++ b/pkg/util/string.go @@ -19,6 +19,9 @@ func SubstringAfter(string string, after string) string { func SubstringBetween(s, start, end string) []byte { var between []byte index := strings.Index(s, start) + if index == -1 { + return between + } index += len(start) for { char := s[index]