go-viper / mapstructure

Go library for decoding generic map values into native Go structures and vice versa.
MIT License
50 stars 10 forks source link

Decode: time.Time field of input struct decoded to the zero value of time.Time in output struct #20

Open garrettladley opened 1 month ago

garrettladley commented 1 month ago

Repost of The time.Time type is converted to empty map from github.com/mitchellh/mapstructure.

When using Decode, the fields of type time.Time from the input struct are being decoded to the zero value of time.Time, time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), in the output struct.

danhawkins commented 1 month ago

I'd like to see the default behaviour here changed also, using the standard RFC3339 or handling time stuct mapping would be ideal