Compare commits

..

1 Commits

Author SHA1 Message Date
bryanqiu
6e98ac9100 add FixToNo0x 2023-01-30 09:33:07 +08:00

8
str.go
View File

@ -126,3 +126,11 @@ func GetEnvDefault(key, defval string) string {
return defval
}
}
// fix hex string to no 0x prefix
func FixToNo0x(hexstr string) string {
if strings.HasPrefix(hexstr, "0x") {
return hexstr[2:]
}
return hexstr
}