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

import (
	"context"
	"fmt"

	"github.com/go-gorp/gorp"

	"github.com/ovh/cds/sdk"
	"github.com/ovh/cds/sdk/exportentities"
)

// Export an environment
func Export(ctx context.Context, db gorp.SqlExecutor, key string, envName string, encryptFunc sdk.EncryptFunc) (exportentities.Environment, error) {
	// Load app
	env, err := LoadEnvironmentByName(db, key, envName)
	if err != nil {
		return exportentities.Environment{}, sdk.WrapError(err, "cannot load %s", envName)
	}

	// Reload variables with clear pass
    
func Export(ctx context.Context, db gorp.SqlExecutor, key string, envName string, encryptFunc sdk.EncryptFunc) (exportentities.Environment, error) {
	// Load app
	env, err := LoadEnvironmentByName(db, key, envName)
	if err != nil {
		return exportentities.Environment{}, sdk.WrapError(err, "cannot load %s", envName)
	}

	// Reload variables with clear password
	variables, err := LoadAllVariablesWithDecrytion(db, env.ID)
	if err != nil {
		return exportentities.Environment{}, err
	}
	env.Variables = variables

	// Reload key
	keys, err := LoadAllKeysWithPrivateContent(db, env.ID)
	if err != nil {
		return exportentities.Environment{}, sdk.WrapError(err, "cannot load env %s keys", envName)
	}
	env.Keys = keys

	return ExportEnvironment(ctx, db, *env, encryptFunc, fmt.Sprintf("env:%d", env.ID))
}