You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: agent.go
    path of file: ./repos/porter/cli/cmd/providers/gcp
    
    the code of the file until where you have to start completion: package gcp

import (
	"context"
	"fmt"
	"net/url"

	admin "cloud.google.com/go/iam/admin/apiv1"
	adminpb "google.golang.org/genproto/googleapis/iam/admin/v1"

	crm "google.golang.org/api/cloudresourcemanager/v1"
	gke "google.golang.org/api/container/v1"
)

type Agent struct {
	Ctx       context.Context
	ProjectID string

	IAMClient                   *admin.IamClient
	CloudRe
    
func (a *Agent) SetServiceAccountIAMPolicy(sa *adminpb.ServiceAccount) error {
	projectSvc := a.CloudResourceManagerService.Projects

	policy, err := projectSvc.GetIamPolicy(
		a.ProjectID,
		&crm.GetIamPolicyRequest{},
	).Do()
	if err != nil {
		return err
	}

	doesExist := false

	// find a container.developer binding if it exists
	for _, binding := range policy.Bindings {
		if binding.Role == "roles/container.developer" {
			doesExist = true
			binding.Members = append(binding.Members, "serviceAccount:"+sa.Email)
			break
		}
	}

	if !doesExist {
		policy.Bindings = append(policy.Bindings, &crm.Binding{
			Members: []string{"serviceAccount:" + sa.Email},
			Role:    "roles/container.developer",
		})
	}

	policy, err = projectSvc.SetIamPolicy(
		a.ProjectID,
		&crm.SetIamPolicyRequest{
			Policy: policy,
		},
	).Do()

	if err != nil {
		return err
	}

	return nil
}