func (pt Provider) LessThan(other Provider) bool {
	switch {
	case pt.Hostname != other.Hostname:
		return pt.Hostname < other.Hostname
	case pt.Namespace != other.Namespace:
		return pt.Namespace < other.Namespace
	default:
		return pt.Type < other.Type
	}
}
LessThan returns true if the receiver should sort before the other given
address in an ordered list of provider addresses.

This ordering is an arbitrary one just to allow deterministic results from
functions that would otherwise have no natural ordering. It's subject
to change in future.
package addrs
import (
	"fmt"
	"strings"
	"golang.org/x/net/idna"
	"github.com/camptocamp/terraboard/internal/terraform/tfdiags"
	"github.com/hashicorp/hcl/v2"
	svchost "github.com/hashicorp/terraform-svchost"
)
type Provider struct {
	Type      string
	Namespace string
	Hostname  svchost.Hostname
}
const DefaultRegistryHost = svchost.Hostname("registry.terraform.io")
const BuiltInProviderHost = svchost.Hostname("terraform.io")
const BuiltInProviderNamespace = "builtin"
const LegacyProviderNamespace = "-"
func (pt Provider) String() string {
	if pt.IsZero() {
		panic("called String on zero-value addrs.Provider")
	}
	return pt.Hostname.ForDisplay() + "/" + pt.Namespace + "/" + pt.Type
}
func (pt Provider) ForDisplay() string {
	if pt.IsZero() {
		panic("called ForDisplay on zero-value addrs.Provider")
	}
	if pt.Hostname == DefaultRegistryHost {
		return pt.Namespace + "/" + pt.Type
	}
	return pt.Hostname.ForDisplay() + "/" + pt.Namespace + "/" + pt.Type
}
func NewProvider(hostname svchost.Hostname, namespace, typeName string) Provider {
	if namespace == LegacyProviderNamespace {
		panic("attempt to create legacy provider address using NewProvider; use NewLegacyProvider instead")
	}
	return Provider{
		Type:      MustParseProviderPart(typeName),
		Namespace: MustParseProviderPart(namespace),
		Hostname:  hostname,
	}
}
func ImpliedProviderForUnqualifiedType(typeName string) Provider {
	switch typeName {
	case "terraform":
		return NewBuiltInProvider(typeName)
	default:
		return NewDefaultProvider(typeName)
	}
}
func NewDefaultProvider(name string) Provider {
	return Provider{
		Type:      MustParseProviderPart(name),
		Namespace: "hashicorp",
		Hostname:  DefaultRegistryHost,
	}
}
func NewBuiltInProvider(name string) Provider {
	return Provider{
		Type:      MustParseProviderPart(name),
		Namespace: BuiltInProviderNamespace,
		Hostname:  BuiltInProviderHost,
	}
}
func NewLegacyProvider(name string) Provider {
	return Provider{
		Type:      name,
		Namespace: LegacyProviderNamespace,
		Hostname:  DefaultRegistryHost,
	}
}
func (pt Provider) LegacyString() string {
	if pt.IsZero() {
		panic("called LegacyString on zero-value addrs.Provider")
	}
	if pt.Namespace != LegacyProviderNamespace && pt.Namespace != BuiltInProviderNamespace {
		panic(pt.String() + " cannot be represented as a legacy string")
	}
	return pt.Type
}
func (pt Provider) IsZero() bool {
	return pt == Provider{}
}
func (pt Provider) IsBuiltIn() bool {
	return pt.Hostname == BuiltInProviderHost && pt.Namespace == BuiltInProviderNamespace
}