mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-17 11:12:28 +08:00
compatible with pointer in convert.ToString
This commit is contained in:
@@ -108,6 +108,13 @@ func ToString(value any) string {
|
||||
if value == nil {
|
||||
return ""
|
||||
}
|
||||
rv := reflect.ValueOf(value)
|
||||
if rv.Kind() == reflect.Ptr {
|
||||
if rv.IsNil() {
|
||||
return ""
|
||||
}
|
||||
return ToString(rv.Elem().Interface())
|
||||
}
|
||||
|
||||
switch val := value.(type) {
|
||||
case float32:
|
||||
|
||||
Reference in New Issue
Block a user