aconfig
aconfig copied to clipboard
Reflection on slice kind ignores tags for field name
The reflection process does not consider struct field tags within a slice. Therefore, the field name must match the tag name, starting with an uppercase letter.
func (l *Loader) m2s(m map[string]interface{}, structValue reflect.Value) error {
for name, value := range m {
name = strings.Title(name)
structFieldValue := structValue.FieldByName(name)
...
https://github.com/cristalhq/aconfig/blob/main/reflection.go#L351
It appears that this issue is main reason of #147