Skip to content

Commit

Permalink
fix: set default to client struct
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidapaulopt committed Dec 6, 2024
1 parent 968578d commit 69b11cc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/targetproviders/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type (
viper *viper.Viper
config config.FilesTargetProviderConfig
configProxies configProxiesList
proxies map[string]proxyConfig
proxies configProxiesList

eventsChan chan targetproviders.TargetEvent
errChan chan error
Expand Down Expand Up @@ -56,12 +56,6 @@ func New(log zerolog.Logger, name string, provider *config.FilesTargetProviderCo
return nil, err
}

// load default values
err = defaults.Set(proxiesList)
if err != nil {
fmt.Printf("Error loading defaults: %v", err)
}

c := &Client{
log: newlog,
name: name,
Expand All @@ -72,6 +66,12 @@ func New(log zerolog.Logger, name string, provider *config.FilesTargetProviderCo
errChan: make(chan error),
}

// load default values
err = defaults.Set(c)
if err != nil {
return nil, fmt.Errorf("Error loading defaults: %w", err)
}

return c, nil
}

Expand Down

0 comments on commit 69b11cc

Please sign in to comment.