func initConfig() {
  if cfgFile != "" {
    // Use config file from the flag.
    viper.SetConfigFile(cfgFile)
  } else {
    // Find home directory.
    home, err := homedir.Dir()
    if err != nil {
      fmt.Println(err)
      os.Exit(1)
    }

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

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

  // If a config file is found, read it in.
  if err := viper.ReadInConfig(); err == nil {
    fmt.Println("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 := homedir.Dir()
    if err != nil {
      fmt.Println(err)
      os.Exit(1)
    }
    viper.AddConfigPath(home)
    viper.SetConfigName(".grpcgo")
  }
  viper.AutomaticEnv() 
  if err := viper.ReadInConfig(); err == nil {
    fmt.Println("Using config file:", viper.ConfigFileUsed())
  }
}
func initConfig ( ) { if cfgFile != " " { viper . SetConfigFile ( cfgFile ) } else { home , err := homedir . Dir ( ) if err != nil { fmt . Println ( err ) os . Exit ( 1 ) } viper . AddConfigPath ( home ) viper . SetConfigName ( " " ) } viper . AutomaticEnv ( ) if err := viper . ReadInConfig ( ) ; err == nil { fmt . Println ( " " , 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 ".grpcgo" (without extension). // read in environment variables that match // If a config file is found, read it in.