code: func createPubSubService(c context.Context, pubSubURL string) (*pubsub.Service, error) {
  	// In real mode (not a unit test), use authenticated transport.
  	var transport http.RoundTripper
  	if pubSubURL == "" {
  		var err error
  		transport, err = auth.GetRPCTransport(c, auth.AsSelf, auth.WithScopes(pubsub.PubsubScope))
  		if err != nil {
  			return nil, err
  		}
  	} else {
  		transport = http.DefaultTransport
  	}
  	service, err := pubsub.New(&http.Client{Transport: transport})
  	if err != nil {
  		return nil, err
  	}
  	if pubSubURL != "" {
  		service.BasePath = pubSubURL
  	}
  	return service, nil
  }
docs: // createPubSubService returns configured instance of pubsub.Service.