make environment variable interpolation preprocessor optional (#1715)
This commit is contained in:
		| @@ -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 | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user