package configure import ( "github.com/liwei1dao/lego/utils/mapstructure" ) type Option func(*Options) type Options struct { ConfigurePath string } func newOptions(config map[string]interface{}, opts ...Option) (Options, error) { options := Options{} if config != nil { mapstructure.Decode(config, &options) } for _, o := range opts { o(&options) } return options, nil } func newOptionsByOption(opts ...Option) (Options, error) { options := Options{} for _, o := range opts { o(&options) } return options, nil }