type Config struct { Order struct { Date time.Time ``yaml:"date" env:"ORDER_DATE" env-layout:"02/01/2006 03:04:05 PM"`` } ``yaml:"order"`` }
Below is the yml file
order: date: 17/01/2022 10:00:00 AM subtime: 5m
I am getting the following error:
config file parsing error: parsing time "Mon Jan 17 10:00:00 2022" as "2006-01-02T15:04:05Z07:00": cannot parse "Mon Jan 17 10:00:00 2022" as "2006"
I also cloned your repo, edited the test eleanenv_test.go to include the following to the TestParseFile function
Time time.Time ``yaml:"time" json:"time" toml:"time" env-layout:"02/01/2006 03:04:05 PM"``
On running the test I got the following errors:
go test github.com/ilyakaznacheev/cleanenv --- FAIL: TestParseFile (0.00s) --- FAIL: TestParseFile/yaml (0.00s) cleanenv_test.go:624: wrong error behavior config file parsing error: parsing time "17/01/2022 10:00:00 AM" as "2006-01-02T15:04:05Z07:00": cannot parse "1/2022 10:00:00 AM" as "2006", wantErr false --- FAIL: TestParseFile/json (0.00s) cleanenv_test.go:624: wrong error behavior config file parsing error: parsing time "\"17/01/2022 10:00:00 AM\"" as "\"2006-01-02T15:04:05Z07:00\"": cannot parse "1/2022 10:00:00 AM\"" as "2006", wantErr false --- FAIL: TestParseFile/toml (0.00s) cleanenv_test.go:624: wrong error behavior config file parsing error: parsing time "17/01/2022 10:00:00 AM" as "2006-01-02T15:04:05Z07:00": cannot parse "1/2022 10:00:00 AM" as "2006", wantErr false FAIL FAIL github.com/ilyakaznacheev/cleanenv 0.004s FAIL
Below given is the configuation file
type Config struct { Order struct { Date time.Time ``yaml:"date" env:"ORDER_DATE" env-layout:"02/01/2006 03:04:05 PM"`` } ``yaml:"order"`` }
Below is the yml file
order: date: 17/01/2022 10:00:00 AM subtime: 5m
I am getting the following error:
config file parsing error: parsing time "Mon Jan 17 10:00:00 2022" as "2006-01-02T15:04:05Z07:00": cannot parse "Mon Jan 17 10:00:00 2022" as "2006"
I also cloned your repo, edited the test eleanenv_test.go to include the following to the
TestParseFile
functionTime time.Time ``yaml:"time" json:"time" toml:"time" env-layout:"02/01/2006 03:04:05 PM"``
On running the test I got the following errors:
go test github.com/ilyakaznacheev/cleanenv --- FAIL: TestParseFile (0.00s) --- FAIL: TestParseFile/yaml (0.00s) cleanenv_test.go:624: wrong error behavior config file parsing error: parsing time "17/01/2022 10:00:00 AM" as "2006-01-02T15:04:05Z07:00": cannot parse "1/2022 10:00:00 AM" as "2006", wantErr false --- FAIL: TestParseFile/json (0.00s) cleanenv_test.go:624: wrong error behavior config file parsing error: parsing time "\"17/01/2022 10:00:00 AM\"" as "\"2006-01-02T15:04:05Z07:00\"": cannot parse "1/2022 10:00:00 AM\"" as "2006", wantErr false --- FAIL: TestParseFile/toml (0.00s) cleanenv_test.go:624: wrong error behavior config file parsing error: parsing time "17/01/2022 10:00:00 AM" as "2006-01-02T15:04:05Z07:00": cannot parse "1/2022 10:00:00 AM" as "2006", wantErr false FAIL FAIL github.com/ilyakaznacheev/cleanenv 0.004s FAIL