cleanenv
cleanenv copied to clipboard
Error after reading time.Duration fields in 1.2.6
Hello, I used v1.2.5 and alway gone all right. But problems with time fields have appeared in 1.2.6.
I have this error pattern:
line N: cannot unmarshal !!int `M` into time.Duration
.
I have config same as:
type Config {
...
Timeout time.Duration `yaml:"timeout"`
...
}
Don't use integer like 5
in your configuration file use 5s
instead.
Note: Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”.