This commit is contained in:
ryan
2026-06-19 15:13:24 +08:00
parent 0b34792709
commit 32861c5db9
376 changed files with 3648 additions and 19957 deletions
+5 -4
View File
@@ -2,14 +2,15 @@ package utils
import "fmt"
// Interface2String converts a string, int, or float64 value to its string representation.
func Interface2String(inter interface{}) string {
switch inter.(type) {
switch v := inter.(type) {
case string:
return inter.(string)
return v
case int:
return fmt.Sprintf("%d", inter.(int))
return fmt.Sprintf("%d", v)
case float64:
return fmt.Sprintf("%f", inter.(float64))
return fmt.Sprintf("%f", v)
}
return "Not Implemented"
}