Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research using reflection for dynamic testing of config struct field members #171

Open
atc0005 opened this issue Nov 29, 2019 · 0 comments
Labels
enhancement New feature or request refactor tests
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Nov 29, 2019

This wouldn't be for the config.Validate() method (not likely due to custom validity logic), but rather to help reduce duplication in the validate_test.go file where (mostly due to ignorance) I am duplicating a lot of the checks:

  • ensure field member is not nil
  • ensure dereferenced field pointer is not of an unacceptable value

If we can dynamically fetch the field names (reflection), we should be able to switch on the type and/or value of each to apply specific checks.

This would come after #161 is worked out and likely after I've done further research.

@atc0005 atc0005 added enhancement New feature or request refactor tests labels Nov 29, 2019
@atc0005 atc0005 added this to the Future milestone Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor tests
Projects
None yet
Development

No branches or pull requests

1 participant