INNER CODE UNIT · Go

initConfig

xm1k3/cent · cmd/root.go:114

func initConfig() {
	if cfgFile != "" {
		viper.SetConfigFile(cfgFile)
	} else {
		configDir, err := utils.GetDataDir()
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}

		viper.AddConfigPath(configDir)
		viper.SetConfigName(".cent")
	}

	viper.AutomaticEnv() // read in environment variables that match

	// If a config file is found, read it in.
	if err := viper.ReadInConfig(); err == nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…