package options import "errors" type BooleanTranscoderOption struct { DefaultValue bool } func (option *BooleanTranscoderOption) IsRequired() bool { return false } func (option *BooleanTranscoderOption) Default() interface{} { return option.DefaultValue } func (option *BooleanTranscoderOption) Validate(value interface{}) (err error) { _, ok := value.(bool) if !ok { err = errors.New("value is not a boolean") return } err = nil return }