func str2json(){ cmd := "['read': 2.0, 'write': 1.2}, {'read_mb': 4.0, 'write': 3.2}]" str := strings.Replace(string(cmd), "'", "\"", -1) str = strings.Replace(str, "\n", "", -1) var dat []map[string]interface{} if err := json.Unmarshal([]byte(str), &dat); err == nil { fmt.Println(dat) //fmt.Println(dat["status"]) } else { fmt.Println(err) } }