Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 94b3c59

Browse files
committed
Refactor to use trimprefix
1 parent d24810e commit 94b3c59

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

util/utils.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ const EmojiPattern = "[\\x{2712}\\x{2714}\\x{2716}\\x{271d}\\x{2721}\\x{2728}\\x
6565

6666
// NormalizeAddress is used to strip the 0x prefix
6767
func NormalizeAddress(addr string) string {
68-
if addr[0:2] == "0x" {
69-
return strings.Replace(addr, "0x", "", 1)
70-
}
71-
return addr
68+
return strings.TrimPrefix(addr, "0x")
7269
}
7370

7471
// AreAddressesEqual - check if addresses are equal after normalizing them

0 commit comments

Comments
 (0)