From de5e61588d1206cfd65f2473dd7a35275112182b Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 12 May 2021 18:44:35 +0300 Subject: [PATCH] vm: simplify some test code gosimple: S1017: should replace this `if` statement with an unconditional `strings.TrimPrefix` --- pkg/vm/json_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/vm/json_test.go b/pkg/vm/json_test.go index f5f85695c..fd3f87860 100644 --- a/pkg/vm/json_test.go +++ b/pkg/vm/json_test.go @@ -454,8 +454,6 @@ func decodeBytes(data []byte) ([]byte, error) { } func decodeHex(s string) ([]byte, error) { - if strings.HasPrefix(s, "0x") { - s = s[2:] - } + s = strings.TrimPrefix(s, "0x") return hex.DecodeString(s) }