feat: Ajouter et documenter configuration par env
This commit is contained in:
parent
4b42f8d215
commit
990fe99e2c
3 changed files with 17 additions and 0 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"git.agecem.com/agecem/bottin-ag/config"
|
||||
"github.com/spf13/cobra"
|
||||
|
@ -52,6 +53,8 @@ func initConfig() {
|
|||
viper.SetConfigName(".bottin-ag")
|
||||
}
|
||||
|
||||
viper.SetEnvPrefix("BOTTINAG")
|
||||
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||
viper.AutomaticEnv() // read in environment variables that match
|
||||
|
||||
// If a config file is found, read it in.
|
||||
|
|
Reference in a new issue