func (f URIReferenceFormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}
	_, err := url.Parse(asString)
	return err == nil && !strings.Contains(asString, `\`)
}
IsFormat checks if input is a correctly formatted URI or relative-reference per RFC3986
package gojsonschema
import (
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"strings"
	"sync"
	"time"
)
type (
	FormatChecker interface {
		IsFormat(input interface{}) bool
	}
	FormatCheckerChain struct {
		formatters map[string]FormatChecker
	}
	EmailFormatChecker struct{}
	IPV4FormatChecker struct{}
	IPV6FormatChecker struct{}
	DateTimeFormatChecker struct{}
	DateFormatChecker struct{}
	TimeFormatChecker struct{}
	URIFormatChecker struct{}
	URIReferenceFormatChecker struct{}
	URITemplateFormatChecker struct{}
	HostnameFormatChecker struct{}
	UUIDFormatChecker struct{}
	RegexFormatChecker struct{}
	JSONPointerFormatChecker struct{}
	RelativeJSONPointerFormatChecker struct{}
)
var (
	FormatCheckers = FormatCheckerChain{
		formatters: map[string]FormatChecker{
			"date":                  DateFormatChecker{},
			"time":                  TimeFormatChecker{},
			"date-time":             DateTimeFormatChecker{},
			"hostname":              HostnameFormatChecker{},
			"email":                 EmailFormatChecker{},
			"idn-email":             EmailFormatChecker{},
			"ipv4":                  IPV4FormatChecker{},
			"ipv6":                  IPV6FormatChecker{},
			"uri":                   URIFormatChecker{},
			"uri-reference":         URIReferenceFormatChecker{},
			"iri":                   URIFormatChecker{},
			"iri-reference":         URIReferenceFormatChecker{},
			"uri-template":          URITemplateFormatChecker{},
			"uuid":                  UUIDFormatChecker{},
			"regex":                 RegexFormatChecker{},
			"json-pointer":          JSONPointerFormatChecker{},
			"relative-json-pointer": RelativeJSONPointerFormatChecker{},
		},
	}
	rxHostname = regexp.MustCompile(`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$`)
	rxURITemplate = regexp.MustCompile("^([^{]*({[^}]*})?)*$")
	rxUUID = regexp.MustCompile("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
	rxJSONPointer = regexp.MustCompile("^(?:/(?:[^~/]|~0|~1)*)*$")
	rxRelJSONPointer = regexp.MustCompile("^(?:0|[1-9][0-9]*)(?:#|(?:/(?:[^~/]|~0|~1)*)*)$")
	lock = new(sync.RWMutex)
)
func (c *FormatCheckerChain) Add(name string, f FormatChecker) *FormatCheckerChain {
	lock.Lock()
	c.formatters[name] = f
	lock.Unlock()
	return c
}
func (c *FormatCheckerChain) Remove(name string) *FormatCheckerChain {
	lock.Lock()
	delete(c.formatters, name)
	lock.Unlock()
	return c
}
func (c *FormatCheckerChain) Has(name string) bool {
	lock.RLock()
	_, ok := c.formatters[name]
	lock.RUnlock()
	return ok
}
func (c *FormatCheckerChain) IsFormat(name string, input interface{}) bool {
	lock.RLock()
	f, ok := c.formatters[name]
	lock.RUnlock()
	if !ok {
		return true
	}
	return f.IsFormat(input)
}
func (f EmailFormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}
	_, err := mail.ParseAddress(asString)
	return err == nil
}
func (f IPV4FormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}
	ip := net.ParseIP(asString)
	return ip != nil && strings.Contains(asString, ".")
}
func (f IPV6FormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}
	ip := net.ParseIP(asString)
	return ip != nil && strings.Contains(asString, ":")
}
func (f DateTimeFormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}
	formats := []string{
		"15:04:05",
		"15:04:05Z07:00",
		"2006-01-02",
		time.RFC3339,
		time.RFC3339Nano,
	}
	for _, format := range formats {
		if _, err := time.Parse(format, asString); err == nil {
			return true
		}
	}
	return false
}
func (f DateFormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}
	_, err := time.Parse("2006-01-02", asString)
	return err == nil
}
func (f TimeFormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}
	if _, err := time.Parse("15:04:05Z07:00", asString); err == nil {
		return true
	}
	_, err := time.Parse("15:04:05", asString)
	return err == nil
}
func (f URIFormatChecker) IsFormat(input interface{}) bool {
	asString, ok := input.(string)
	if !ok {
		return false
	}
	u, err := url.Parse(asString)
	if err != nil || u.Scheme == "" {
		return false
	}
	return !strings.Contains(asString, `\`)
}