Files
core/vendor/github.com/lufia/plan9stats/opts.go
Jan Stabenow 9c0b535199 Add v16.7.2
2022-05-13 19:26:45 +02:00

22 lines
289 B
Go

package stats
type Config struct {
rootdir string
}
type Option func(*Config)
func newConfig(opts ...Option) *Config {
var cfg Config
for _, opt := range opts {
opt(&cfg)
}
return &cfg
}
func WithRootDir(dir string) Option {
return func(cfg *Config) {
cfg.rootdir = dir
}
}