func (o *OptionsProvider) IsSet(field string) bool {
	return o.set[field]
}
Check if the field is set
package options
import (
	"fmt"
	"reflect"
)
type Spec interface{}
type Option interface{}
type OptionsProvider struct {
	spec Spec
	m    map[string]string
	set  map[string]bool  
}
func NewOptions(spec Spec) *OptionsProvider {
	o := &OptionsProvider{spec, make(map[string]string), make(map[string]bool)}
	v := reflect.ValueOf(spec)
	if v.CanSet() {
		panic(fmt.Sprintf("The spec passed in must be a pointer, got type %v",
			v.Type().Name()))
	}
	v = v.Elem()
	specType := v.Type()
	for i := 0; i < specType.NumField(); i++ {
		field := specType.Field(i)
		o.m[field.Type.Name()] = field.Name
	}
	return o
}
func (o *OptionsProvider) Options(opts ...Option) *OptionsProvider {
	for _, opt := range opts {
		optType := reflect.TypeOf(opt)
		if _, ok := optType.FieldByName("Value"); !ok {
			panic(fmt.Sprintf("Option %v doesn't have a Value field.", optType.Name()))
		}
		fieldName := o.m[optType.Name()]
		field := reflect.ValueOf(o.spec).Elem().FieldByName(fieldName)
		if !field.CanSet() || !field.IsValid() {
			panic(fmt.Sprintf("There is no option %v.", optType.Name()))
		}
		field.Set(reflect.ValueOf(opt))
		o.set[fieldName] = true
	}
	return o
}
func (o *OptionsProvider) Get() interface{} {
	return o.spec
}