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

[component] deprecate component.UnmarshalConfig #9141

Closed

Conversation

atoulme
Copy link
Contributor

@atoulme atoulme commented Dec 19, 2023

Description:
Deprecate component.UnmarshalConfig. Prefer conf.Unmarshal(cfg) instead
This PR also makes the WithErrorUnused() option enabled by default.

Link to tracking Issue:
Fixes #7102

Documentation:
Added deprecation information

@atoulme atoulme requested a review from a team as a code owner December 19, 2023 05:24
@@ -27,12 +27,9 @@ var configValidatorType = reflect.TypeOf((*ConfigValidator)(nil)).Elem()
// UnmarshalConfig helper function to UnmarshalConfig a Config.
// It checks if the config implements confmap.Unmarshaler and uses that if available,
// otherwise uses Map.UnmarshalExact, erroring if a field is nonexistent.
// Deprecated: Use `conf.Unmarshal(cfg)` instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment, and why this is needed

@atoulme
Copy link
Contributor Author

atoulme commented Dec 19, 2023

Indeed, that's not a good solution, closing.

@atoulme atoulme closed this Dec 19, 2023
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.

Remove component.UnmarshalConfig
2 participants