You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objects are now encodable and decodable.
But the interface changed.
The Object interface is a plain.Encoder
there is a function objects.PlainDecode(r io.Reader) (Object, error)
for decoding (in order to dispatch the respective object decoder
after an object header.
Inside, this uses the following pattern (note upper/lower case)
type object struct {...}
func (o *object) plainEncode(w io.Writer) error // called by full objects
func (o *object) plainDecode(r io.Reader) error //
// implements plain decode, but privately to the package.
type hdr struct { *object }
func (h hdr) PlainDecode(r io.Reader) error
example concrete object:
type Array struct { object .... }
func (a *Array) PlainEncode(w io.Writer) error // implements plain.Encoder
// implements plain decoding, but only after the header.
func (a *Array) plainDecode(r io.Reader) error
0 commit comments