Closed liranp closed 5 years ago
Nice! Looks like we have an issue in travis that's preventing your build from passing. I'll try to figure out what's going on so we can get this merged ASAP
Okay so the latest PR should fix your build problem. Mind rebasing on the latest master?
Done. Thank you!
Description
We are trying to use this package to initialize a
time.Duration
field but getting an error when the answer is written to the target struct by core/write.go#L189-L190. This PR adds support for struct fields of typetime.Duration
.Example
Answering with a string in an integer format (for example, 30) returns the following error:
reflect.Set: value of type int64 is not assignable to type time.Duration
Answering with a string in a valid duration format (for example, 30s) returns the following error:
strconv.ParseInt: parsing "30s": invalid syntax