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

Commit

Permalink
Refactor to use trimprefix
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmabc committed Sep 18, 2020
1 parent d24810e commit 94b3c59
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94b3c59

Please sign in to comment.