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 56fc3441da
commit c6cf1b98f8
3 changed files with 33 additions and 11 deletions

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{} {