Answer the question
In order to leave comments, you need to log in
How to add slice to map?
message := map[string]string{
"cmd": "subscribe",
"auth_key": "dfb496cca67e13b",
"needed_bk": []string {"live"}
}
Answer the question
In order to leave comments, you need to log in
We need to change the map type to map[string]interface{}
Like this
message := map[string]interface{}{
"cmd": "subscribe",
"auth_key": "dfb496cca67e13b",
"needed_bk": []string {"live"},
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question