Do not serialize message arguments when they are empty
This commit is contained in:
parent
67dd1d6bfb
commit
85050e6154
|
@ -72,7 +72,13 @@ func Encode(msg *Message) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
|
||||
return result + "[" + string(jsonMethod) + "," + msg.Args + "]", nil
|
||||
encoded := result + "[" + string(jsonMethod)
|
||||
if msg.Args != "" {
|
||||
encoded += "," + msg.Args
|
||||
}
|
||||
encoded += "]"
|
||||
|
||||
return encoded, nil
|
||||
}
|
||||
|
||||
func MustEncode(msg *Message) string {
|
||||
|
|
Loading…
Reference in New Issue