Documentation ¶ Index ¶ type Config func Make(options ...Option) (*Config, error) type ConfigBuilder func (cb *ConfigBuilder) Build() (*Config, error) type Option func Count(count int) Option func IsErr(isErr bool) Option func Name(name string) Option Examples ¶ ConfigBuilder.Build Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Config ¶ type Config struct { Name string IsErr bool Count int } func Make ¶ func Make(options ...Option) (*Config, error) type ConfigBuilder ¶ type ConfigBuilder struct { // contains filtered or unexported fields } func (*ConfigBuilder) Build ¶ func (cb *ConfigBuilder) Build() (*Config, error) Example ¶ x1, y1 := Make( Name("1"), IsErr(true), Count(3), ) x2, y2 := Make( Name("1"), Count(3), ) fmt.Println(x1, y1) fmt.Println(x2, y2) Output: <nil> IsErr &{1 false 3} <nil> type Option ¶ type Option func(cb *ConfigBuilder) error func Count ¶ func Count(count int) Option func IsErr ¶ func IsErr(isErr bool) Option func Name ¶ func Name(name string) Option Source Files ¶ View all Source files configfuncw.go Click to show internal directories. Click to hide internal directories.