Dump changes

This commit is contained in:
Andrey Chervyakov 2022-06-03 23:44:08 +06:00
parent e12550a643
commit aac2ea1b74
Signed by: cognio
GPG key ID: DAA316147EB0D58D
25 changed files with 129 additions and 76 deletions

View file

@ -1,22 +0,0 @@
package brainbuffer
import (
"github.com/knadh/koanf"
"github.com/knadh/koanf/providers/env"
"strings"
)
func NewConfig() *koanf.Koanf {
config := koanf.New(".")
loadValues(config)
return config
}
func loadValues(c *koanf.Koanf) {
envProvider := env.Provider("", ".", func(s string) string {
return strings.Replace(strings.ToLower(s), "_", ".", -1)
})
_ = c.Load(envProvider, nil)
}