12 factor configuration as a typesafe struct in as little as two function calls
FromOptional(file)
API for easier local dev without ignoring/parsing err
support for *url.URL
fields
internal rearchitecture. If any bugs were introduced please open an issue.
Adds new Sub
method on Builder
which populates the target struct starting at the provided prefix
time.Duration
values are now parsed using the time.ParseDuration
ruleset!
fixed bug where zero values for ints and bools would falsely error.
Error handling!
To(*struct)
now returns an error.
I know this was a much requested feature, I too wanted idiomatic error handling. I just needed to sit on it a bit to find the right solution.
Hoping to improve it in the near future with a concrete and inspectable error type, keep an eye out for that.
Clearer error messages Better handling of file i/o errors
type MyConfig struct {
DatabaseURL string `config:"DATABASE_URL"`
}
v1.0.0