// 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() {
	viper.SetConfigType("yaml")
	if cfgFile != "" {
		viper.SetConfigFile(cfgFile)
	} else {
		home, err := homedir.Dir()
		if err != nil {
			log.Errorf("Error while finding home directory: %v", err)
			os.Exit(1)
		}
		viper.AddConfigPath(".")
		viper.AddConfigPath(home)
		viper.AddConfigPath("/etc/scooter/")
		viper.SetConfigName("scooter")
	}
}
func initConfig ( ) { viper . SetConfigType ( " " ) if cfgFile != " " { viper . SetConfigFile ( cfgFile ) } else { home , err := homedir . Dir ( ) if err != nil { log . Errorf ( " " , err ) os . Exit ( 1 ) } viper . AddConfigPath ( " " ) viper . AddConfigPath ( home ) viper . AddConfigPath ( " " ) viper . SetConfigName ( " " ) } }
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. // viper.AutomaticEnv()