// initConfig reads in config file and ENV variables if set.
initConfig reads in config file and ENV variables if set.
// initConfig reads in config file and ENV variables if set .
func initConfig() {
	if cfgFile != "" {
		viper.SetConfigFile(cfgFile)
	} else {
		home, err := homedir.Dir()
		cobra.CheckErr(err)
		viper.AddConfigPath(home)
		viper.SetConfigName(".todo")
	}
	viper.AutomaticEnv() 
	if err := viper.ReadInConfig(); err == nil {
		fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
	}
}
func initConfig ( ) { if cfgFile != " " { viper . SetConfigFile ( cfgFile ) } else { home , err := homedir . Dir ( ) cobra . CheckErr ( err ) viper . AddConfigPath ( home ) viper . SetConfigName ( " " ) } viper . AutomaticEnv ( ) if err := viper . ReadInConfig ( ) ; err == nil { fmt . Fprintln ( os . Stderr , " " , viper . ConfigFileUsed ( ) ) } }
initConfig reads in config file and ENV variables if set.
initConfig reads in config file and ENV variables if set .
// read in environment variables that match // If a config file is found, read it in.