Partly JSON unmarshal into a map in Go
This can be accomplished by Unmarshaling into a map[string]json.RawMessage. var objmap map[string]json.RawMessage err := json.Unmarshal(data, &objmap) To further parse sendMsg, you could then do something like: var s sendMsg err = json.Unmarshal(objmap[“sendMsg”], &s) For say, you can do the same thing and unmarshal into a string: var str string err = json.Unmarshal(objmap[“say”], &str) EDIT: Keep … Read more