mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
Update App version to 0.0.4
Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
@@ -22,6 +22,22 @@ func toString(v interface{}) (string, error) {
|
||||
return v, nil
|
||||
case null.String:
|
||||
return v.String, nil
|
||||
case []string:
|
||||
if len(v) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
if len(v) == 1 {
|
||||
return v[0], nil
|
||||
}
|
||||
return strings.Join(v, ","), nil
|
||||
case []interface{}:
|
||||
if len(v) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
if s, ok := v[0].(string); ok {
|
||||
return s, nil
|
||||
}
|
||||
return "", fmt.Errorf("unsupported type in slice: %T", v[0])
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("unsupported type: %s", reflect.TypeOf(v))
|
||||
|
||||
Reference in New Issue
Block a user