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.go
    path of file: ./repos/terraformer/tests/datadog
    
    the code of the file until where you have to start completion: // Copyright 2018 The Terraformer Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compli
    
func main() {
	var terraformerServices []string
	var terraformerFilters []string

	provider := &datadog_terraforming.DatadogProvider{}
	cfg, _ := getConfig()

	// CD into 'tests/datadog/resources'
	err := os.Chdir(datadogResourcesPath)
	if err != nil {
		handleFatalErr(cfg, err, "Error changing directory: ")
	}
	// Run the terraform v13 upgrade command if applicable
	if strings.Contains(cfg.tfVersion, "0.13.") {
		if err := cmdRun(cfg, []string{commandTerraformV13Upgrade}); err != nil {
			handleFatalErr(cfg, err, "Error running command 'terraform 0.13upgrade'")
		}
	}
	// Initialize the Datadog provider in dir 'tests/datadog/resources'
	err = initializeDatadogProvider(cfg)
	if err != nil {
		handleFatalErr(cfg, err, "Error initializing the Datadog provider: ")
	}

	// Create datadog resources
	resourcesMap, err := createDatadogResource(cfg)
	if err != nil {
		handleFatalErr(cfg, err, "Error creating resources")
	}

	// Get list of terraformerServices and terraformerFilters from created resources
	for resource, resourceID := range *resourcesMap {
		terraformerServices = append(terraformerServices, resource)
		terraformerFilters = append(terraformerFilters, fmt.Sprintf("%s=%s", resource, strings.Join(resourceID, ":")))
	}
	if len(terraformerServices) == 0 {
		terraformerServices = getAllServices(provider)
	}

	// Delete the 'generated/' directory if it already exists
	_ = os.RemoveAll("generated/")

	// Import created resources with Terraformer
	err = cmd.Import(provider, cmd.ImportOptions{
		Resources:   terraformerServices,
		PathPattern: "{output}/",
		PathOutput:  cmd.DefaultPathOutput,
		State:       "local",
		Connect:     true,
		Output:      "hcl",
		Filter:      terraformerFilters,
		Verbose:     true,
	}, []string{cfg.Datadog.apiKey, cfg.Datadog.appKey, cfg.Datadog.apiURL})
	if err != nil {
		handleFatalErr(cfg, err, "Error while importing resources")
	}

	// Run tests on created and imported resources
	err = terraformerResourcesTest(cfg, resourcesMap)
	if err != nil {
		handleFatalErr(cfg, err, "Terraform resource test step failed")
	}

	// Destroy created resources
	err = destroyDatadogResources(cfg)
	if err != nil {
		log.Fatal("Error while destroying resources ", err)
	}

	log.Print("Successfully created and imported resources with Terraformer")
}