-
Notifications
You must be signed in to change notification settings - Fork 1
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
Ned's very WIP proposal for the API #1
Conversation
built_in_fields.go
Outdated
sourceGetter, err := callback(i) | ||
if err == nil { | ||
f.source = sourceGetter.GetSource() | ||
if f.source != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is f.source
is the latest source intentionally? May be to call it f.latestSource
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm true, but I'm not sure which is clearer though 😕 My thinking was that this is the source that actually produced the value at dest
after the consolidation. While latestSource
also means the same think, it can also be confused with the top-level source (e.g. CLI flags), since it was tried last, even when it didn't return an actual value.
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...
This is very, very far from final, but it's an expansion on the ad-hoc proposal I sent in Slack, together with the rough requirements in and a basic TODO proposal the README.