Closed pcurren-atlassian closed 4 months ago
Example struct configuration:
type WorkerConfig struct { ThingA int `default:"100"` ThingB time.Duration `split_words:"true" default:"10s"` Thing C string `split_words:"true" required:"true"` }
If I set an environment variable called WORKER_THING_B with an non parsable time like "1abcd"
WORKER_THING_B
And then parse with:
func (wc *WorkerConfig) Process() error { return envconfig.Process("worker", wc) }
I would expect an error but instead the WorkerConfig has a default "zero" value for ThingB.
Version: github.com/kelseyhightower/envconfig v1.4.0
github.com/kelseyhightower/envconfig v1.4.0
My mistake! Sorry for wasting your time. It does error!
Example struct configuration:
If I set an environment variable called
WORKER_THING_B
with an non parsable time like "1abcd"And then parse with:
I would expect an error but instead the WorkerConfig has a default "zero" value for ThingB.