Skip to content

Thoughts on adding a .Set(k, v) method?  #191

@hoshsadiq

Description

@hoshsadiq

Viper has a Set(key string, value interface{}) method, which allows for easy updating values.

Koanf does not, thus leading to code like this all over the place:

_ = k.Load(confmap.Provider(map[string]interface{}{key: value}, "."), nil)

It would be nice to be able to set individual values so that we can simply do:

k.Set(key, value)

I'd be happy to raise PR if you're okay with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions