Skip to content

Commit

Permalink
fix: use koanfv2 for imported module (#212)
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
  • Loading branch information
fzipi authored Nov 24, 2023
1 parent a4cd40e commit 95544b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/knadh/koanf/providers/env"
"github.com/knadh/koanf/providers/file"
"github.com/knadh/koanf/providers/rawbytes"
"github.com/knadh/koanf/v2"
koanfv2 "github.com/knadh/koanf/v2"
)

// NewDefaultConfig initializes the configuration with default values
Expand Down Expand Up @@ -128,9 +128,9 @@ func (c *FTWConfiguration) WithMaxMarkerLogLines(amount int) {
}

// Unmarshal the loaded koanf instance into a configuration object
func unmarshal(k *koanf.Koanf) (*FTWConfiguration, error) {
func unmarshal(k *koanfv2.Koanf) (*FTWConfiguration, error) {
config := NewDefaultConfig()
err := k.UnmarshalWithConf("", config, koanf.UnmarshalConf{Tag: "koanf"})
err := k.UnmarshalWithConf("", config, koanfv2.UnmarshalConf{Tag: "koanf"})
if err != nil {
return nil, err
}
Expand All @@ -139,7 +139,7 @@ func unmarshal(k *koanf.Koanf) (*FTWConfiguration, error) {
}

// Get the global koanf instance
func getKoanfInstance() *koanf.Koanf {
func getKoanfInstance() *koanfv2.Koanf {
// Use "." as the key path delimiter. This can be "/" or any character.
return koanf.New(".")
return koanfv2.New(".")
}

0 comments on commit 95544b8

Please sign in to comment.