code: func getSwarmingHost(c context.Context, host string) (string, error) {
  	settings := common.GetSettings(c)
  	if settings.Swarming == nil {
  		err := errors.New("swarming not in settings")
  		logging.WithError(err).Errorf(c, "Go configure swarming in the settings page.")
  		return "", err
  	}
  
  	if host == "" || host == settings.Swarming.DefaultHost {
  		return settings.Swarming.DefaultHost, nil
  	}
  	// If it is specified, validate the hostname.
  	for _, allowed := range settings.Swarming.AllowedHosts {
  		if host == allowed {
  			return host, nil
  		}
  	}
  	return "", errors.New("unknown swarming host", grpcutil.InvalidArgumentTag)
  }
docs: // getSwarmingHost returns default hostname if host is empty.
  // If host is not empty and not allowed, returns an error.