feat(option): enhance UpdateOption to handle various value types and improve validation

This commit is contained in:
CaIon
2025-09-03 14:30:25 +08:00
parent 1bbabda081
commit f0183785c9
3 changed files with 33 additions and 11 deletions
+9 -1
View File
@@ -123,8 +123,16 @@ func Interface2String(inter interface{}) string {
return fmt.Sprintf("%d", inter.(int))
case float64:
return fmt.Sprintf("%f", inter.(float64))
case bool:
if inter.(bool) {
return "true"
} else {
return "false"
}
case nil:
return ""
}
return "Not Implemented"
return fmt.Sprintf("%v", inter)
}
func UnescapeHTML(x string) interface{} {