(inter interface{})
| 29 | } |
| 30 | |
| 31 | func 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 | |
| 52 | func Any2Int(data any) int { |
| 53 | if data == nil { |
nothing calls this directly
no outgoing calls
no test coverage detected