From 4072fa5d13b6c3bbc11e5e0f6b8a6d8a0ac0fe0f Mon Sep 17 00:00:00 2001 From: kpacha Date: Tue, 10 Sep 2024 21:37:48 +0200 Subject: [PATCH] remove intermediate vars --- errors.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/errors.go b/errors.go index 0750c1d..0f5511a 100644 --- a/errors.go +++ b/errors.go @@ -71,9 +71,7 @@ func ToError(e error) error { } originalMsg := e.Error() - start := strings.Index(originalMsg, ":") - errMsg := originalMsg[start+2:] - errMsgParts := strings.Split(errMsg, separator) + errMsgParts := strings.Split(originalMsg[strings.Index(originalMsg, ":")+2:], separator) if len(errMsgParts) == 0 { return e