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

codify: replace valast.Addr(v).(*T) with k8s.io/utils/pointer equivalents? #83

Open
dnwe opened this issue Oct 8, 2021 · 1 comment

Comments

@dnwe
Copy link

dnwe commented Oct 8, 2021

πŸ‘‹πŸ» Firstly, thank you so much for naml β€” it is wonderful!


It would be great if the codify-generated code could avoid the runtime dependency on valast by using the k8s.io/utils/pointer package for getting pointers to a primitive:

e.g.,

-valast.Addr(false).(*bool)
+pointer.Bool(false)
-valast.Addr(int64(65534)).(*int64)
+pointer.Int64(65534)

etc.

This also produces more readable code.

Obviously there's no built-in support in valast for customising the generated ast so it would have to be a post-processing task done in codify itself

@krisnova
Copy link
Owner

krisnova commented Oct 9, 2021

interested in opening a PR for this?

this change seems reasonable to me

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

No branches or pull requests

2 participants