From 94b3c59bb6a4e9081b22dcc0e2e414e81ccccd99 Mon Sep 17 00:00:00 2001 From: Brian Hoffman Date: Fri, 18 Sep 2020 11:44:19 -0400 Subject: [PATCH] Refactor to use trimprefix --- util/utils.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/util/utils.go b/util/utils.go index 7b98efff1f..cde76f84e6 100644 --- a/util/utils.go +++ b/util/utils.go @@ -65,10 +65,7 @@ const EmojiPattern = "[\\x{2712}\\x{2714}\\x{2716}\\x{271d}\\x{2721}\\x{2728}\\x // NormalizeAddress is used to strip the 0x prefix func NormalizeAddress(addr string) string { - if addr[0:2] == "0x" { - return strings.Replace(addr, "0x", "", 1) - } - return addr + return strings.TrimPrefix(addr, "0x") } // AreAddressesEqual - check if addresses are equal after normalizing them