dnscrypt-proxy/vendor/github.com/ashanbrown/forbidigo/forbidigo/config_options.go

46 lines
1.0 KiB
Go

package forbidigo
// Code generated by github.com/launchdarkly/go-options. DO NOT EDIT.
type ApplyOptionFunc func(c *config) error
func (f ApplyOptionFunc) apply(c *config) error {
return f(c)
}
func newConfig(options ...Option) (config, error) {
var c config
err := applyConfigOptions(&c, options...)
return c, err
}
func applyConfigOptions(c *config, options ...Option) error {
c.ExcludeGodocExamples = true
for _, o := range options {
if err := o.apply(c); err != nil {
return err
}
}
return nil
}
type Option interface {
apply(*config) error
}
// OptionExcludeGodocExamples don't check inside Godoc examples (see https://blog.golang.org/examples)
func OptionExcludeGodocExamples(o bool) ApplyOptionFunc {
return func(c *config) error {
c.ExcludeGodocExamples = o
return nil
}
}
// OptionIgnorePermitDirectives don't check for `permit` directives(for example, in favor of `nolint`)
func OptionIgnorePermitDirectives(o bool) ApplyOptionFunc {
return func(c *config) error {
c.IgnorePermitDirectives = o
return nil
}
}