func FilterHyperlinks(URL string, links []string) []string {
	index := 0
	for _, link := range links {
		if strings.Contains(link, URL) {
			links[index] = link
			index++
		}
	}
	return links[:index]
}
FilterHyperlinks filters out links that
lead away from the original domain URL
package parser
import (
	"net/http"
	"strings"
	"golang.org/x/net/html"
)
func GetHyperlinks(BaseURL string, response *http.Response) []string {
	var links []string
	token := html.NewTokenizer(response.Body)
	for {
		tokenIterator := token.Next()
		tokenTest := token.Token()
		switch {
		case tokenIterator == html.ErrorToken:
			return links
		case tokenIterator == html.StartTagToken:
			if tokenTest.Data != "a" {
				continue
			}
			url := GetLinkHelper(tokenTest.Attr)
			if url == "" || url == "/" || url == "#" || url == BaseURL {
				continue
			}
			if strings.Index(url, "http") == 0 {
				links = append(links, url)
				continue
			}
			if ValidateURL(BaseURL+url) == nil {
				links = append(links, BaseURL+url)
			}
		}
	}
}
func GetLinkHelper(tokenAttribute []html.Attribute) string {
	if len(tokenAttribute) == 0 {
		return ""
	}
	if tokenAttribute[0].Key == "href" {
		return tokenAttribute[0].Val
	}
	return GetLinkHelper(tokenAttribute[1:])
}