solidarity-service/config.go

17 lines
284 B
Go
Raw Normal View History

2023-10-20 11:41:39 +00:00
package main
import (
"github.com/spf13/viper"
"strings"
)
func ReadConfig() (*viper.Viper, error) {
v := viper.New()
v.SetConfigName("config")
v.AddConfigPath(".")
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
v.AutomaticEnv()
err := v.ReadInConfig()
return v, err
}