Closed lorenzodonini closed 1 year ago
The new json.Encoder approach introduced in https://github.com/lorenzodonini/ocpp-go/pull/168 didn't trim newlines from json messages, which is the default behavior of the Encode function (see reference).
json.Encoder
Encode
Per OCPP spec a message shouldn't contain any trailing newline. This PR fixes the wrong behavior by trimming the introduced newline at the end of each generated message.
The new
json.Encoder
approach introduced in https://github.com/lorenzodonini/ocpp-go/pull/168 didn't trim newlines from json messages, which is the default behavior of theEncode
function (see reference).Per OCPP spec a message shouldn't contain any trailing newline. This PR fixes the wrong behavior by trimming the introduced newline at the end of each generated message.