func extractLinkInfo(href string, url string) (isAccessible bool, isExternal bool, err error) {
	h, err := netURL.Parse(href)
	if err != nil || h.Host == "" || h.Scheme == "" {
		// href link is not accessible, therefore it is not
		// considered as external either.
		return false, false, nil
	}

	u, err := netURL.Parse(url)
	if err != nil || h.Host == "" || h.Scheme == "" {
		// comparer url must be valid, ideally this should never happen.
		return false, false, errors.New("provided host url is invalid")
	}

	if h.Host == u.Host {
		// if both hosts are the same, then the link is accessible but not external.
		return true, false, nil
	} else {
		// if both hosts are different, then the link is accessible and external.
		return true, true, nil
	}
}
// extractLinkInfo is used to identify if a href value is
// accessible or inaccessible, and internal or external.
extractLinkInfo is used to identify if a href value is
accessible or inaccessible, and internal or external.
// extractLinkInfo is used to identify if a href value is // accessible or inaccessible and internal or external .
func extractLinkInfo(href string, url string) (isAccessible bool, isExternal bool, err error) {
	h, err := netURL.Parse(href)
	if err != nil || h.Host == "" || h.Scheme == "" {
		return false, false, nil
	}
	u, err := netURL.Parse(url)
	if err != nil || h.Host == "" || h.Scheme == "" {
		return false, false, errors.New("provided host url is invalid")
	}
	if h.Host == u.Host {
		return true, false, nil
	} else {
		return true, true, nil
	}
}
func extractLinkInfo ( href string , url string ) ( isAccessible bool , isExternal bool , err error ) { h , err := netURL . Parse ( href ) if err != nil || h . Host == " " || h . Scheme == " " { return false , false , nil } u , err := netURL . Parse ( url ) if err != nil || h . Host == " " || h . Scheme == " " { return false , false , errors . New ( " " ) } if h . Host == u . Host { return true , false , nil } else { return true , true , nil } }
extractLinkInfo is used to identify if a href value is
accessible or inaccessible, and internal or external.
extractLinkInfo is used to identify if a href value is accessible or inaccessible and internal or external .
// href link is not accessible, therefore it is not // considered as external either. // comparer url must be valid, ideally this should never happen. // if both hosts are the same, then the link is accessible but not external. // if both hosts are different, then the link is accessible and external.