Skip to content

Commit 13cf766

Browse files
committed
fix: var initialization
1 parent 1b57d3e commit 13cf766

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

util/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ func GetHexString(data any) string {
431431
if reflect.TypeOf(data).Kind() == reflect.Float64 {
432432
result = fmt.Sprintf("%x", int64(data.(float64)))
433433
} else if reflect.TypeOf(data).Kind() == reflect.String {
434-
result, ok := strings.CutPrefix(data.(string), "0x")
434+
var ok bool
435+
result, ok = strings.CutPrefix(data.(string), "0x")
435436
if !ok {
436437
result = data.(string)
437438
}

0 commit comments

Comments
 (0)