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: main_test.go
    path of file: ./repos/lakeFS/esti
    
    the code of the file until where you have to start completion: package esti

import (
	"context"
	"flag"
	"fmt"
	"net/http"
	"os"
	"slices"
	"strings"
	"testing"

	"github.com/aws/aws-sdk-go-v2/service/s3"
	"github.com/go-openapi/swag"
	"github.com/hashicorp/go-multierror"
	"github.com/spf13/viper"
	"github.com/treeverse/lakefs/pkg/api/apigen"
	"github.com/treeverse/lakefs/pkg/api/apiutil"
	"github.com/treeverse/lakefs/pkg/logging"
	"github.com/treeverse/lakefs/pkg/testutil"
)

const (
	DefaultAdminAccessKeyID     = "AKIAIOSFDNN7EXAMPLEQ"
	DefaultAdminSecretAccessKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
)

type (
	arrayFlags []string
)

var (
	logger      logging.Logger
	client      apigen.ClientWithResponsesInterface
	endpointURL string
	s
    
func deleteAllGroups(ctx context.Context, client apigen.ClientWithResponsesInterface, groupsToKeep arrayFlags) error {
	// list groups to delete
	var (
		groupsToDelete []string
		nextOffset     string
	)
	for {
		resp, err := client.ListGroupsWithResponse(ctx, &apigen.ListGroupsParams{After: apiutil.Ptr(apigen.PaginationAfter(nextOffset))})
		if err != nil {
			return fmt.Errorf("list groups: %w", err)
		}
		if resp.StatusCode() != http.StatusOK {
			return fmt.Errorf("list groups: status: %s", resp.Status())
		}
		for _, group := range resp.JSON200.Results {
			if !slices.Contains(groupsToKeep, swag.StringValue(group.Name)) {
				groupsToDelete = append(groupsToDelete, group.Id)
			}
		}
		if !resp.JSON200.Pagination.HasMore {
			break
		}
		nextOffset = resp.JSON200.Pagination.NextOffset
	}

	// delete groups
	var errs *multierror.Error
	for _, id := range groupsToDelete {
		resp, err := client.DeleteGroupWithResponse(ctx, id)
		if err != nil {
			errs = multierror.Append(errs, fmt.Errorf("delete group: %s, err: %w", id, err))
		} else if resp.StatusCode() != http.StatusNoContent {
			errs = multierror.Append(errs, fmt.Errorf("delete group: %s, status: %s", id, resp.Status()))
		}
	}
	return errs.ErrorOrNil()
}