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: loader_user_consumer.go
    path of file: ./repos/cds/engine/api/authentication
    
    the code of the file until where you have to start completion: package authentication

import (
	"context"

	"github.com/go-gorp/gorp"

	"github.com/ovh/cds/engine/api/group"
	"github.com/ovh/cds/engine/api/user"
	"github.com/ovh/cds/sdk"
)

// LoadUserConsumerOptionFunc for auth consumer.
type LoadUserConsumerOptionFunc func(context.Context, gorp.SqlExecutor, ...*sdk.AuthUserConsumer) error

// LoadUserConsumerOptions provides all options on auth consumer loads functions.
var LoadUserConsumerOptions = struct {
	Default                          LoadUserConsumer
    
func loadConsumerGroups(ctx context.Context, db gorp.SqlExecutor, cs ...*sdk.AuthUserConsumer) error {
	var groupIDs []int64
	for i := range cs {
		groupIDs = append(groupIDs, cs[i].AuthConsumerUser.GroupIDs...)
	}

	// Load all groups for given ids
	gs, err := group.LoadAllByIDs(ctx, db, groupIDs)
	if err != nil {
		return err
	}

	// Set groups on each consumers
	mGroups := gs.ToMap()
	for i := range cs {
		cs[i].AuthConsumerUser.Groups = make([]sdk.Group, 0, len(cs[i].AuthConsumerUser.GroupIDs))
		for _, groupID := range cs[i].AuthConsumerUser.GroupIDs {
			cs[i].AuthConsumerUser.Groups = append(cs[i].AuthConsumerUser.Groups, mGroups[groupID])
		}
	}

	return nil
}