-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Unmarshalv2 #10132
base: main
Are you sure you want to change the base?
Unmarshalv2 #10132
Conversation
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10132 +/- ##
==========================================
- Coverage 91.87% 91.60% -0.27%
==========================================
Files 360 354 -6
Lines 16725 16773 +48
==========================================
- Hits 15366 15365 -1
- Misses 1021 1065 +44
- Partials 338 343 +5 ☔ View full report in Codecov by Sentry. |
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.
Overall I like this more since we can preserve "unmarshal" configuration (e.g. errorUnused).
// UnmarshalerV2 interface may be implemented by types to customize their behavior when being unmarshaled from a Conf. | ||
type UnmarshalerV2 interface { | ||
// UnmarshalV2 unmarshals the struct in a custom way. | ||
UnmarshalV2(unmarshal func(interface{}) error) error |
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.
Can you please document how the "unmarshal" func can be used?
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
WIP to discuss a new Unmarshaler interface.