I have no clue what I'm doing wrong, I look up steps online what to do and they all tell me to just go to CMD, type in go get ___ and then just import the github link into my file but I constantly get the could not import error in VS Code.
I am trying to parse some HTML code that I get from a response and I need the "golang.org/x/net/html" to be able to do things. Can someone please tell me what I'm doing wrong?
You can use go modules to manage dependencies.
First you initialize your module with
go mod init ProjectName. Then when you build your project withgo buildit will find and download missing packages to module cache directory which is~/go/pkg/mod.You can use
go mod tidyalso.For more information: Go Modules