MCPcopy Create free account
hub / github.com/LumaAI-API/Luma-API / Any2String

Function Any2String

common/utils.go:31–50  ·  view source on GitHub ↗
(inter interface{})

Source from the content-addressed store, hash-verified

29}
30
31func Any2String(inter interface{}) string {
32 if inter == nil {
33 return ""
34 }
35 switch inter.(type) {
36 case string:
37 return inter.(string)
38 case *string:
39 ptr, ok := inter.(*string)
40 if !ok || ptr == nil {
41 return ""
42 }
43 return *ptr
44 case int, int64:
45 return fmt.Sprintf("%d", inter)
46 case float64:
47 return fmt.Sprintf("%f", inter)
48 }
49 return "Not Implemented"
50}
51
52func Any2Int(data any) int {
53 if data == nil {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected