package main type Option struct { Code OptionCode Data []byte } func (o Option) Size() uint8 { if len(o.Data) > 0 { return uint8(o.Data[0]) } return 0 } type Options map[OptionCode]Option func (opts Options) HasOption(code OptionCode) bool { _, exists := opts[code] return exists }