Skip to content

Commit

Permalink
remove intermediate vars
Browse files Browse the repository at this point in the history
  • Loading branch information
kpacha committed Sep 10, 2024
1 parent 9d6cfeb commit 4072fa5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4072fa5

Please sign in to comment.