fix: issues
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@@ -28,6 +30,10 @@ func (c *Config) GetMaxSize() uint {
|
||||
}
|
||||
|
||||
func Load(path string) error {
|
||||
path, err := filepath.Abs(path)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to get the absolute path of the config file %s", path)
|
||||
}
|
||||
// Load the config file
|
||||
viper.SetConfigFile(path)
|
||||
viper.AutomaticEnv()
|
||||
|
||||
Reference in New Issue
Block a user