This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Description
Code:
type Event struct {
Operation OpCode `json:"op"` /* OpCode is an int */
Sequence uint64 `json:"s"`
Type string `json:"t"`
RawData jsoniter.RawMessage `json:"d"`
}
...
var e *Event
decoder := jsoniter.NewDecoder(reader)
if err = decoder.Decode(&e); err != nil {
return errors.Wrap(err, "decoding message")
}
Error:
time="2017-09-04T11:00:57+03:00" level=error msg="Event handler failed" error="decoding message: discord.Event: Sequence: readUint64: unexpected character: \xff, parsing 15 ...null,\"s\":n... at {\"t\":null,\"s\":null,\"op\":10,\"d\":{\"heartbeat_interval\":41250,\"_trace\":[\"gateway-prd-main-wkd0\"]}}"
Note, code works 100% fine with stdlib json Decode.
I also tried the stdlib config in jsoniter, without any success.