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

Custom Types #4

Closed
wants to merge 18 commits into from
Closed

Custom Types #4

wants to merge 18 commits into from

Conversation

codebien
Copy link
Collaborator

What I don't like from the latest API's iteration is the requirement to re-declare the type into the To method. It's repetition and it opens to have a mismatch between types.

I tried to implement a solution to remove it and re-use the already passed type in the first argument. I know, it requires using interface{} and type checking that is not optimal.

na-- and others added 18 commits June 25, 2021 09:45
This will allow us to have CLI flags, I think...
This is temporarily done via the pflag library, though it's a very poor fit for our use case
Since we're "driving" the parsing in manual, we get the quotes and have to strip them
This is a prototype of how we can have a completely custom field with type-safe defaults and JSON unmarshalling, at the cost of referencing the destination multiple times...
WIP proposal 2, with very basic (and ugly) CLI flag support
@codebien codebien requested review from na-- and artych June 29, 2021 15:04
@codebien codebien self-assigned this Jun 29, 2021
Base automatically changed from ned-wip to main June 30, 2021 15:48
@codebien codebien closed this Jul 1, 2021
@na-- na-- deleted the ip-custom-types branch July 2, 2021 18:01
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.

None yet

2 participants