diff --git a/model_loader/model_loader.go b/model_loader/model_loader.go index 1a608d6..ede11dc 100644 --- a/model_loader/model_loader.go +++ b/model_loader/model_loader.go @@ -170,7 +170,7 @@ func loadValue(key string, arg interface{}, field reflect.Value) error { func getFieldByName(model reflect.Value, name string) (reflect.Value, error) { field := model.Elem().FieldByName(name) if !field.IsValid() { - return reflect.ValueOf(nil), fmt.Errorf("Field `%s` does not exist.", name) + return reflect.ValueOf(nil), fmt.Errorf("Unknown option or argument: `%s`.", name) } return field, nil } diff --git a/model_loader/model_loader_test.go b/model_loader/model_loader_test.go index c261a40..7d13293 100644 --- a/model_loader/model_loader_test.go +++ b/model_loader/model_loader_test.go @@ -199,7 +199,7 @@ var testCases = []modelLoaderTestCase{ args: map[string]interface{}{ "UnknownField": "some value", }, - err: "Field `UnknownField` does not exist.", + err: "Unknown option or argument: `UnknownField`.", }, // Fails with different type mismatches. {