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: regional_utils.go
    path of file: ./repos/magic-modules/mmv1/third_party/terraform/tpgresource
    
    the code of the file until where you have to start completion: package tpgresource

import (
	"fmt"
	"strings"

	transport_tpg "github.com/hashicorp/terr
    
func GetLocation(d TerraformResourceData, config *transport_tpg.Config) (string, error) {
	if v, ok := d.GetOk("location"); ok {
		return GetResourceNameFromSelfLink(v.(string)), nil
	} else if v, isRegionalCluster := d.GetOk("region"); isRegionalCluster {
		return GetResourceNameFromSelfLink(v.(string)), nil
	} else {
		if v, ok := d.GetOk("zone"); ok {
			return GetResourceNameFromSelfLink(v.(string)), nil
		} else {
			if config.Region != "" {
				return GetResourceNameFromSelfLink(config.Region), nil
			} else if config.Zone != "" {
				return GetResourceNameFromSelfLink(config.Zone), nil
			} else {
				return "", fmt.Errorf("Unable to determine location: region/zone not configured in resource/provider config")
			}
		}
	}
}