diff --git a/pkg/configutil/once.go b/pkg/configutil/once.go index 00e2a2a46..0e162146e 100644 --- a/pkg/configutil/once.go +++ b/pkg/configutil/once.go @@ -25,6 +25,7 @@ var ( // configInfo is the config.json data configInfo *config.Config configOnce sync.Once + err error ) // LoadConfigOnce returns the previously read config file. @@ -32,7 +33,6 @@ var ( // or return a default config if not found. // The returned config is only suitable for read only scenarios for short-lived processes. func LoadConfigOnce() (*config.Config, error) { - var err error configOnce.Do(func() { configInfo, err = config.LoadConfig() if err != nil {