func Resolve(backend bind.ContractBackend, input string) (address common.Address, err error) {
	if strings.Contains(input, ".") {
		return resolveName(backend, input)
	}
	if (strings.HasPrefix(input, "0x") && len(input) > 42) || (!strings.HasPrefix(input, "0x") && len(input) > 40) {
		err = errors.New("address too long")
	} else {
		address = common.HexToAddress(input)
		if address == UnknownAddress {
			err = errors.New("could not parse address")
		}
	}
	return
}
Resolve resolves an ENS name in to an Etheruem address
This will return an error if the name is not found or otherwise 0
package ens
import (
	"bytes"
	"compress/zlib"
	"errors"
	"io"
	"io/ioutil"
	"math/big"
	"strings"
	"github.com/ethereum/go-ethereum/accounts/abi/bind"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/wealdtech/go-ens/v3/contracts/resolver"
)
var zeroHash = make([]byte, 32)
var UnknownAddress = common.HexToAddress("00")
type Resolver struct {
	Contract     *resolver.Contract
	ContractAddr common.Address
	domain       string
}
func NewResolver(backend bind.ContractBackend, domain string) (*Resolver, error) {
	registry, err := NewRegistry(backend)
	if err != nil {
		return nil, err
	}
	ownerAddress, err := registry.Owner(domain)
	if err != nil {
		return nil, err
	}
	if bytes.Equal(ownerAddress.Bytes(), UnknownAddress.Bytes()) {
		return nil, errors.New("unregistered name")
	}
	resolver, err := registry.ResolverAddress(domain)
	if err != nil {
		return nil, err
	}
	return NewResolverAt(backend, domain, resolver)
}
func NewResolverAt(backend bind.ContractBackend, domain string, address common.Address) (*Resolver, error) {
	contract, err := resolver.NewContract(address, backend)
	if err != nil {
		return nil, err
	}
	nameHash, err := NameHash("test.eth")
	if err != nil {
		return nil, err
	}
	_, err = contract.Addr(nil, nameHash)
	if err != nil {
		if err.Error() == "no contract code at given address" {
			return nil, errors.New("no resolver")
		}
		return nil, err
	}
	return &Resolver{
		Contract:     contract,
		ContractAddr: address,
		domain:       domain,
	}, nil
}
func PublicResolverAddress(backend bind.ContractBackend) (common.Address, error) {
	return Resolve(backend, "resolver.eth")
}
func (r *Resolver) Address() (common.Address, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return UnknownAddress, err
	}
	return r.Contract.Addr(nil, nameHash)
}
func (r *Resolver) SetAddress(opts *bind.TransactOpts, address common.Address) (*types.Transaction, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return nil, err
	}
	return r.Contract.SetAddr(opts, nameHash, address)
}
func (r *Resolver) MultiAddress(coinType uint64) ([]byte, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return nil, err
	}
	return r.Contract.Addr0(nil, nameHash, big.NewInt(int64(coinType)))
}
func (r *Resolver) SetMultiAddress(opts *bind.TransactOpts, coinType uint64, address []byte) (*types.Transaction, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return nil, err
	}
	return r.Contract.SetAddr0(opts, nameHash, big.NewInt(int64(coinType)), address)
}
func (r *Resolver) PubKey() ([32]byte, [32]byte, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return [32]byte{}, [32]byte{}, err
	}
	res, err := r.Contract.Pubkey(nil, nameHash)
	return res.X, res.Y, err
}
func (r *Resolver) SetPubKey(opts *bind.TransactOpts, x [32]byte, y [32]byte) (*types.Transaction, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return nil, err
	}
	return r.Contract.SetPubkey(opts, nameHash, x, y)
}
func (r *Resolver) Contenthash() ([]byte, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return nil, err
	}
	return r.Contract.Contenthash(nil, nameHash)
}
func (r *Resolver) SetContenthash(opts *bind.TransactOpts, contenthash []byte) (*types.Transaction, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return nil, err
	}
	return r.Contract.SetContenthash(opts, nameHash, contenthash)
}
func (r *Resolver) InterfaceImplementer(interfaceID [4]byte) (common.Address, error) {
	nameHash, err := NameHash(r.domain)
	if err != nil {
		return UnknownAddress, err
	}
	return r.Contract.InterfaceImplementer(nil, nameHash, interfaceID)
}