diff options
author | Valery Piashchynski <[email protected]> | 2021-01-13 15:30:54 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-13 15:30:54 +0300 |
commit | 2a1c6092056c9dc1d725e393da97b72eb65071c4 (patch) | |
tree | 362f0eacdf2373bf208441577c1e69b8337bd71e /plugins/config/plugin.go | |
parent | f0f2b1aaf8e4df2ab65c6c47d9183f072ac86841 (diff) | |
parent | 2eed81d8fdbf8ee5134bb3b3f4c11c63cf6d757c (diff) |
Merge pull request #473 from spiral/feature/env_variables
feat(env): Add RR system environment variables
Diffstat (limited to 'plugins/config/plugin.go')
-rwxr-xr-x | plugins/config/plugin.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/config/plugin.go b/plugins/config/plugin.go index 1a170448..9cecf9f9 100755 --- a/plugins/config/plugin.go +++ b/plugins/config/plugin.go @@ -64,6 +64,15 @@ func (v *Viper) UnmarshalKey(name string, out interface{}) error { return nil } +func (v *Viper) Unmarshal(out interface{}) error { + const op = errors.Op("config unmarshal") + err := v.viper.Unmarshal(&out) + if err != nil { + return errors.E(op, err) + } + return nil +} + // Get raw config in a form of config section. func (v *Viper) Get(name string) interface{} { return v.viper.Get(name) |