func IsLocalEndpoint(url string) bool {
	return !MatchesScheme(url) && !MatchesScpLike(url)
}
IsLocalEndpoint returns true if the given URL string specifies a
local file endpoint.  For example, on a Linux machine,
`/home/user/src/go-git` would match as a local endpoint, but
`https://github.com/src-d/go-git` would not.
package url
import (
	"regexp"
)
var (
	isSchemeRegExp   = regexp.MustCompile(`^[^:]+: 
	scpLikeUrlRegExp = regexp.MustCompile(`^(?:(?P<user>[^@]+)@)?(?P<host>[^:\s]+):(?:(?P<port>[0-9]{1,5})/)?(?P<path>[^\\].*)$`)
)
func MatchesScheme(url string) bool {
	return isSchemeRegExp.MatchString(url)
}
func MatchesScpLike(url string) bool {
	return scpLikeUrlRegExp.MatchString(url)
}
func FindScpLikeComponents(url string) (user, host, port, path string) {
	m := scpLikeUrlRegExp.FindStringSubmatch(url)
	return m[1], m[2], m[3], m[4]
}