prevent gookit/config to merge proxy values with default values

This commit is contained in:
A.Unger
2021-11-18 11:44:08 +01:00
parent fe61ad4154
commit c22d3fc24d
5 changed files with 11 additions and 44 deletions
+2
View File
@@ -7,6 +7,7 @@ import (
"strings"
gofig "github.com/gookit/config/v2"
goojson "github.com/gookit/config/v2/json"
gooyaml "github.com/gookit/config/v2/yaml"
)
@@ -69,6 +70,7 @@ func BindSourcesToStructs(extension string, dst interface{}) (*gofig.Config, err
sources := DefaultConfigSources(extension, supportedExtensions)
cnf := gofig.NewWithOptions(extension, gofig.ParseEnv)
cnf.AddDriver(gooyaml.Driver)
cnf.AddDriver(goojson.Driver)
_ = cnf.LoadFiles(sources...)
err := cnf.BindStruct("", &dst)