make environment variable interpolation preprocessor optional (#1715)

This commit is contained in:
Colin Hoglund
2020-07-06 15:13:35 -04:00
committed by GitHub
parent 97ae2979ad
commit 90dca65f55
5 changed files with 62 additions and 12 deletions

View File

@@ -10,7 +10,8 @@ import (
)
type Options struct {
Encoding map[string]encoder.Encoder
Encoding map[string]encoder.Encoder
DisableReplaceEnvVars bool
}
type Option func(o *Options)
@@ -40,3 +41,10 @@ func WithEncoder(e encoder.Encoder) Option {
o.Encoding[e.String()] = e
}
}
// WithDisableReplaceEnvVars disables the environment variable interpolation preprocessor
func WithDisableReplaceEnvVars() Option {
return func(o *Options) {
o.DisableReplaceEnvVars = true
}
}