There is another improvement you can do: you are currently using
cfg := Config{Name: &nameField}
r := reflect.ValueOf(cfg)
which means that 'r' will contain a copy of 'cfg' and will not be settable.
If instead you use:
r := reflect.ValueOf(&cfg).Elem()
then r will contain a *pointer* to the original 'cfg' and can modify it (the reflect.Value 'r' is settable).
In turn, this also allows to declare 'Config' as follows:
```