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: cross_provider_move.go
    path of file: ./repos/terraform/internal/refactoring
    
    the code of the file until where you have to start completion: // Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1

package refactoring

import (
	"fmt"

	"github.com/hashicorp/hcl/v2"
	"github.com/zclconf/go-cty/cty"

	"github.com/hashicorp/terraform/internal/addrs"
	"github.com/hashicorp/terraform/internal/configs/configschema"
	"github.com/hashicorp/terraform/internal/providers"
	"github.com/hashicorp/terra
    
func (m *crossTypeMover) getProvider(providers addrs.Provider) (providers.Interface, error) {
	if provider, ok := m.ProviderCache[providers]; ok {
		return provider, nil
	}

	if factory, ok := m.ProviderFactories[providers]; ok {
		provider, err := factory()
		if err != nil {
			return nil, err
		}

		m.ProviderCache[providers] = provider
		return provider, nil
	}

	// Then we don't have a provider in the cache - this represents a bug in
	// Terraform since we should have already loaded all the providers in the
	// configuration and the state.
	return nil, fmt.Errorf("provider %s implementation not found; this is a bug in Terraform - please report it", providers)
}