I'm trying to figure out how to stop the execution of my program when the field
is not found in the example below.
If FieldByName(key)
returns a zero Value how can I warn the user that the field was not found?
field := mutable.FieldByName(key)
// need to figure out if the field exists before calling .Type() on it
if field.X == Y {
log.Fatalf("Unable to find [%s] in Config object", key)
}
switch field.Type().Name() {
}