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: cloud9.go
    path of file: ./repos/cloudfox/aws/sdk
    
    the code of the file until where you have to start completion: package sdk

import (
	"context"
	"encoding/gob"

	"github.com/BishopFox/cloudfox/internal"
	"github.com/aws/aws-sdk-go-v2/service/cloud9"
	cloud9Types "github.com/aws/aws-sdk-go
    
func CachedCloud9ListEnvironments(client AWSCloud9ClientInterface, accountID string, region string) ([]string, error) {
	var PaginationControl *string
	var environments []string
	cacheKey := "cloud9-ListEnvironments-" + accountID + "-" + region
	cached, found := internal.Cache.Get(cacheKey)
	if found {
		return cached.([]string), nil
	}
	for {
		ListEnvironments, err := client.ListEnvironments(
			context.TODO(),
			&cloud9.ListEnvironmentsInput{
				NextToken: PaginationControl,
			},
			func(o *cloud9.Options) {
				o.Region = region
			},
		)

		if err != nil {
			return environments, err
		}

		environments = append(environments, ListEnvironments.EnvironmentIds...)

		//pagination
		if ListEnvironments.NextToken == nil {
			break
		}
		PaginationControl = ListEnvironments.NextToken
	}

	internal.Cache.Set(cacheKey, environments, cache.DefaultExpiration)
	return environments, nil
}