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

Add Set(key, val) shorthand for Merge(). #192

Merged
merged 1 commit into from
Jan 19, 2023
Merged

Add Set(key, val) shorthand for Merge(). #192

merged 1 commit into from
Jan 19, 2023

Conversation

knadh
Copy link
Owner

@knadh knadh commented Jan 18, 2023

When there are multiple mutations to be made at many places, Load(), Merge(), MergeAt() requires a lot of boilerplate code.

Set(key string, val interface{}) is a new shorthand that allows a value to be directly merge at the given key without having to initialize a new Koanf{} object.

Closes #191.

When there are multiple mutations to be made at many places,
`Load(), Merge(), MergeAt()` requires a lot of boilerplate code.

`Set(key string, val interface{})` is a new shorthand that allows
a value to be directly merge at the given key without having to
initialize a new Koanf{} object.

Closes #191.
@knadh knadh added the enhancement New feature or request label Jan 18, 2023
@knadh knadh merged commit 56ec85e into master Jan 19, 2023
@knadh knadh deleted the set branch August 16, 2024 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thoughts on adding a .Set(k, v) method?
1 participant