I am having problems importing "golang.org/x/net/html", it just tells me that it cannot find the package. Looking around the Internet, I only confused me with the fact that some people say that you can’t use it anymore, some people say to do this: Install exp / html in Go and some people say that it’s just using "golang.org/ x / net / html "is working fine.
Here is just a small part of the code I'm trying to run:
package main
import (
"fmt"
"html"
"net/http"
"golang.org/x/net/html"
"os"
"strings"
)
func getHref(t html.Token) (ok bool, href string) {
for _, a := range t.Attr {
if a.Key == "href" {
href = a.Val
ok = true
}
}
return
}
This will obviously not allow me to use the html token, because I cannot import the package.
source
share