Skip to content

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

Merged
knadh merged 1 commit intomasterfrom
set
Jan 19, 2023
Merged

Add Set(key, val) shorthand for Merge().#192
knadh merged 1 commit intomasterfrom
set

Conversation

@knadh
Copy link
Copy Markdown
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