mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
Updated imports and generate automatic environment with viper
This commit is contained in:
parent
2b421e8af5
commit
2edcb2199e
2 changed files with 5 additions and 4 deletions
|
|
@ -3,7 +3,7 @@ package magellan
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bikeshack/magellan/internal/util"
|
||||
"github.com/OpenCHAMI/magellan/internal/util"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
|
|
@ -16,6 +16,7 @@ func LoadConfig(path string) error {
|
|||
// ...no search paths set intentionally, so config has to be set explicitly
|
||||
// ...also, the config file will not save anything
|
||||
// ...and finally, parameters passed to CLI have precedence over config values
|
||||
viper.AutomaticEnv()
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||
return fmt.Errorf("config file not found: %w", err)
|
||||
|
|
@ -25,4 +26,4 @@ func LoadConfig(path string) error {
|
|||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue