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

Unmarshalv2 #10132

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Unmarshalv2 #10132

wants to merge 17 commits into from

Conversation

atoulme
Copy link
Contributor

@atoulme atoulme commented May 10, 2024

WIP to discuss a new Unmarshaler interface.

atoulme and others added 17 commits April 30, 2024 16:41
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>
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 91.60%. Comparing base (fe582df) to head (056a9c2).
Report is 142 commits behind head on main.

Files Patch % Lines
confmap/confmap.go 62.50% 6 Missing and 6 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bogdandrutu bogdandrutu left a 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
Copy link
Member

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?

Copy link
Contributor

github-actions bot commented Jun 5, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants