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

config/: enforce type constraints via generics, not reflection #72

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

Al2Klimov
Copy link
Member

No description provided.

@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Sep 19, 2024
config/config.go Outdated Show resolved Hide resolved
config/config.go Show resolved Hide resolved
config/config.go Show resolved Hide resolved
config/config.go Show resolved Hide resolved
Copy link
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already implemented something similar when I did the library splitting, but without passing a parameter. In the end I removed the whole thing because it is more straightforward to actually pass a parameter:

Icinga/icingadb#747 (comment)

In general, I like the changes here!

config/contracts.go Outdated Show resolved Hide resolved
@yhabteab yhabteab added this to the 0.4.0 milestone Oct 18, 2024
@yhabteab yhabteab added the enhancement New feature or request label Oct 18, 2024
@yhabteab yhabteab merged commit f25f8a0 into main Oct 18, 2024
15 checks passed
@yhabteab yhabteab deleted the reflectPtr branch October 18, 2024 10:27
lippserd added a commit that referenced this pull request Oct 21, 2024
This reverts commit f25f8a0, reversing
changes made to a2fd4d4.

While the changes relax the necessary checks for passing a valid pointer, they
complicate the tests and still allow non-construct pointer types that implement
the validator interface to pass. This negates the benefits, making it simpler
to validate the pointer argument in a function as previously done.
@yhabteab yhabteab removed this from the 0.4.0 milestone Oct 21, 2024
yhabteab added a commit that referenced this pull request Oct 21, 2024
Revert "Merge pull request #72 from Icinga/reflectPtr"
@oxzi oxzi added this to the 0.4.0 milestone Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants