Skip to content

Commit 70ef53d

Browse files
committed
[fix] safer panic for unwanted type
calling Interface() may trigger a further panic.
1 parent a649fc7 commit 70ef53d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reflect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func valueToStr(v reflect.Value) (str string) {
4343
case reflect.Int:
4444
str = strconv.FormatInt(v.Int(), 10)
4545
default:
46-
panic(fmt.Sprintf("valueToStr: %v is of unexpected kind %q", v.Interface(), v.Kind()))
46+
panic(fmt.Sprintf("valueToStr: %v is of unexpected kind %q", v, v.Kind()))
4747
}
4848
return
4949
}

0 commit comments

Comments
 (0)