options.go 283 B

1234567891011121314151617
  1. package conf
  2. type (
  3. // Option defines the method to customize the config options.
  4. Option func(opt *options)
  5. options struct {
  6. env bool
  7. }
  8. )
  9. // UseEnv customizes the config to use environment variables.
  10. func UseEnv() Option {
  11. return func(opt *options) {
  12. opt.env = true
  13. }
  14. }