func initConfig() {
	if cfgFile != "" {
		// Use config file from the flag.
		viper.SetConfigFile(cfgFile)
	} else {
		// Find home directory.
		home, err := os.UserHomeDir()
		cobra.CheckErr(err)

		// Search config in home directory with name ".annoyme" (without extension).
		viper.AddConfigPath(home)
		viper.SetConfigType("yaml")
		viper.SetConfigName(".annoyme")
	}

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

	// If a config file is found, read it in.
	if err := viper.ReadInConfig(); err == nil {
		fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
	}
}
// 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 := os.UserHomeDir()
		cobra.CheckErr(err)
		viper.AddConfigPath(home)
		viper.SetConfigType("yaml")
		viper.SetConfigName(".annoyme")
	}
	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 := os . UserHomeDir ( ) cobra . CheckErr ( err ) viper . AddConfigPath ( home ) viper . SetConfigType ( " " ) 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 .
// Use config file from the flag. // Find home directory. // Search config in home directory with name ".annoyme" (without extension). // read in environment variables that match // If a config file is found, read it in.