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

feat: provide an example of typed resource type #368

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DmitriyMV
Copy link
Member

This is something that I wanted to try for a while - attach the resource type directly to the resource.Type constant. The (partial) result is this PR. While it may look interesting, I don't think that we should merge it ATM.

Because:

  1. There are a LOT of Naked() calls around the code.
  2. This will require a lot of refactoring. Even here it required a lot of places to be changed.
  3. I'm not sure that this level of generic abuse is worth it (will it increase the resulting binary size because of the bloat?).

Still, this is the good starting point if anyone is interested in how it could be done.

This is something that I wanted to try for a while - attach the resource type directly to the resource.Type constant.
The (partial) result is this PR. While it may look interesting, I don't think that we should merge it ATM.

Because:
1. There are a LOT of `Naked()` calls around the code.
2. This will require a lot of refactoring. Even here it required a lot of places to be changed.
3. I'm not sure that this level of generic abuse is worth it (will it increase the resulting binary size because of the bloat?).

Still, this is the good starting point if anyone is interested in how it could be done.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant