Golang convert interface to map

I am trying to create a function that could accept following

*struct
[]*struct
map[string]*struct

Here struct could be any struct not just a specific one. Converting interface to *struct or []*struct is working fine. But giving error for map.

If the map value can be any type, then use reflect to iterate through the map:

if v.Kind() == reflect.Map {
    for _, key := range v.MapKeys() {
        strct := v.MapIndex(key)
        fmt.Println(key.Interface(), strct.Interface())
    }
}