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: dao_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/lib/pq"
	"github.com/rockbears/log"

	"github.com/ovh/cds/engine/api/database/gorpmapping"
	"github.com/ovh/cds/en
    
func getUserConsumers(ctx context.Context, db gorp.SqlExecutor, q gorpmapping.Query, opts ...LoadUserConsumerOptionFunc) (sdk.AuthUserConsumers, error) {
	consumers, err := getConsumers(ctx, db, q)
	if err != nil {
		return nil, err
	}
	userConsumers := make([]*sdk.AuthUserConsumer, 0, len(consumers))

	for i := range consumers {
		uc := sdk.AuthUserConsumer{
			AuthConsumer: consumers[i],
		}
		if err := loadConsumerUserDataByConsumerID(ctx, db, &uc); err != nil {
			return nil, err
		}
		userConsumers = append(userConsumers, &uc)
	}

	if len(userConsumers) > 0 {
		for i := range opts {
			if err := opts[i](ctx, db, userConsumers...); err != nil {
				return nil, err
			}
		}
	}

	fullUserConsumers := make([]sdk.AuthUserConsumer, 0, len(userConsumers))
	for i := range userConsumers {
		fullUserConsumers = append(fullUserConsumers, *userConsumers[i])
	}

	return fullUserConsumers, nil
}