configor icon indicating copy to clipboard operation
configor copied to clipboard

Fix default value in slices

Open moycat opened this issue 3 years ago • 4 comments

The default values are applied before the config is loaded. So the later loaded structs in the slice don't have default values.

https://github.com/jinzhu/configor/blob/1095c485b440be00e1ddf075f4acdbebc3d6e97e/utils.go#L375-L391

Loading the default values after parsing config files and env should fix this.

Related to #67.

moycat avatar Jul 16 '21 03:07 moycat

This will not work, it break something else

hulucc avatar Jul 26 '21 03:07 hulucc

This will not work, it break something else

What’s broken?

moycat avatar Jul 26 '21 04:07 moycat

This will not work, it break something else

What’s broken?

I don't remember but i tired to change like this locally, somethings else go wrong.

hulucc avatar Jul 26 '21 10:07 hulucc

This will not work, it break something else

What’s broken?

I don't remember but i tired to change like this locally, somethings else go wrong.

Well, at least no tests fail. You can add a unit test when you remember it.

moycat avatar Jul 26 '21 10:07 moycat