I have a map[int]interface{}, but I don't know if it is a good way to add this code to
func NewJsonNode(n interface{}, options ...option) (JsonNode, error) {, or is there any way to transfrom it into a map[string]interaface{}
case map[int]interface{}:
m := make(jsonObject)
for k, v := range t {
if _, ok := v.(JsonNode); !ok {
e, err := NewJsonNode(v, options...)
if err != nil {
return nil, err
}
m[strconv.Itoa(k)] = e
}
}
return m, nil
I have a map[int]interface{}, but I don't know if it is a good way to add this code to func NewJsonNode(n interface{}, options ...option) (JsonNode, error) {, or is there any way to transfrom it into a map[string]interaface{}