code: func NewModeViper(appPath string, envAppName, env string) *viper.Viper {
  	newViper := viper.New()
  	newViper.SetConfigType("toml")
  	newViper.SetConfigFile(filepath.Join(appPath, AppConfigFilename))
  	newViper.SetEnvPrefix(envAppName)
  	newViper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
  
  	if env == "" {
  		return newViper
  	}
  
  	// Do nothing on errors here, so we can fallback to other validation
  	// methods. Users can use env vars or cmd line flags if a config is not found.
  	err := testHarnessViperReadConfig(newViper)
  	if err != nil {
  		return newViper
  	}
  
  	modeViper := newViper.Sub(fmt.Sprintf("%s.db", env))
  	if modeViper == nil {
  		return newViper
  	}
  
  	return modeViper
  }
docs: // NewModeViper creates a viper.Viper with config path and environment prefixes
  // set. It also specifies a Sub of the active environment (the chosen env mode)
  // and reads in the database config file section.