don't use map structure if we're already a map
This commit is contained in:
parent
2ddac95715
commit
8bf7379170
1 changed files with 9 additions and 7 deletions
|
@ -195,7 +195,8 @@ func (ws *cmdHandler) handleMsg(r io.Reader) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
nd := newData(cmd)
|
nd := newData(cmd)
|
||||||
err = mapstructure.Decode(&msgMap, &nd)
|
if _, ok := nd.(map[string]interface{}); !ok {
|
||||||
|
err := mapstructure.Decode(&msgMap, &nd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ws.writeError(id, Error{
|
ws.writeError(id, Error{
|
||||||
Code: "invalid_format",
|
Code: "invalid_format",
|
||||||
|
@ -204,6 +205,7 @@ func (ws *cmdHandler) handleMsg(r io.Reader) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return hand(ws, id, cmd, nd)
|
return hand(ws, id, cmd, nd)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue