[Solved] Create string from map[string]interface{} [closed]


Have you tried anything? There’s lots of ways to do what you’re trying to do. Some more peprformant than others, some easier to write… This would be a quick way to implement what you need:

func PrintStr(m map[string]interface{}) {
    parts := make([]string, 0, len(m))
    for k, v := range m {
        parts = append(parts, fmt.Sprintf("%s=%v", k, v))
    }
    fmt.Printf("%s\n", strings.Join(parts, ";"))
}

0

solved Create string from map[string]interface{} [closed]