Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 880 Bytes

README.md

File metadata and controls

41 lines (33 loc) · 880 Bytes

Go source code translations

The Go source code uses msgpack-go for the MessagePack encoding.

Constant

const Pi = 3.141592

Enumeration

type E int // or int64 if the ordinal exceeds 32 bit

const (
    This E = 1 // 'EThis' for scoped enums
    That E = 2 // 'EThat' for scoped enums
)

func (e E) EncodeMsgpack(w *msgpack.Writer) error  { ... }
func (e *E) DecodeMsgpack(r *msgpack.Reader) error { ... }

Struct

type S struct {
    Foo int
    Bar float32
}

func (s *S) EncodeMsgpack(w *msgpack.Writer) error { ... }
func (s *S) DecodeMsgpack(r *msgpack.Reader) error { ... }

Union

type U struct {
    Value interface{} // has to be type asserted
}

func (u U) EncodeMsgpack(w *msgpack.Writer) error  { ... }
func (u *U) DecodeMsgpack(r *msgpack.Reader) error { ... }