Environmental installation

Under the environment of Windows installation go, reference docs.studygolang.com/doc/install.

Then install the official vscode plug-in go. You need to rely on some go plug-ins, and then use the process will prompt you to install: Go tools that the Go Extension depends on · Microsoft/ VScode-go Wiki, but the direct installation will fail.

After referring to this article, we successfully installed the go plug-in – HackerVirus – blog garden in vscode. The main reason for the failure is that the library relied on during compilation was not found, you can download and move to the corresponding path. Enron restarted vscode automatic installation line.

Have a problem

But in the end there was a tool github.com derekparker delve CMD DLV that kept failing to be installed.

PS C:\Go\src> go install .\github.com\derekparker\delve\cmd\dlv\
crypto\tls\cipher_suites.go:18:2: cannot find package "golang_org/x/crypto/chacha20poly1305" in any of:
        C:\Go\src\golang_org\x\crypto\chacha20poly1305 (from $GOROOT)
        C:\Users\talen\go\src\golang_org\x\crypto\chacha20poly1305 (from $GOPATH)
crypto\tls\key_agreement.go:20:2: cannot find package "golang_org/x/crypto/curve25519" in any of:
        C:\Go\src\golang_org\x\crypto\curve25519 (from $GOROOT)
        C:\Users\talen\go\src\golang_org\x\crypto\curve25519 (from $GOPATH)
net\http\h2_bundle.go:46:2: cannot find package "golang_org/x/net/http2/hpack" in any of:
        C:\Go\src\golang_org\x\net\http2\hpack (from $GOROOT)
        C:\Users\talen\go\src\golang_org\x\net\http2\hpack (from $GOPATH)
net\http\h2_bundle.go:47:2: cannot find package "golang_org/x/net/idna" in any of:
        C:\Go\src\golang_org\x\net\idna (from $GOROOT)
        C:\Users\talen\go\src\golang_org\x\net\idna (from $GOPATH)
net\http\h2_bundle.go:48:2: cannot find package "golang_org/x/net/lex/httplex" in any of:
        C:\Go\src\golang_org\x\net\lex\httplex (from $GOROOT)
        C:\Users\talen\go\src\golang_org\x\net\lex\httplex (from $GOPATH)
net\http\transport.go:32:2: cannot find package "golang_org/x/net/proxy" in any of:
        C:\Go\src\golang_org\x\net\proxy (from $GOROOT)
        C:\Users\talen\go\src\golang_org\x\net\proxy (from $GOPATH)

Copy the code

At first I thought the library was not downloaded, and then I downloaded it to GOPATH,GOROOT in the same way as before, but it kept getting wrong. Refer to this article:

The GOROOT/ SRC path does not have vender, but PKG does, so install it again and run it again.

The errors that mention “cannot find package” are looking for some packages that are vendored in ~/godev/src/vendor/golang_net/…. However, the vendoring support added in 1.5/1.6 only works when the package is inside the GOPATH or GOROOT. Your godev installation is not (and should not be) inside GOPATH and GOROOT is pointing to your 1.8.1 install.

After searching for many devious ways, Google could hardly find many answers. I searched for “issue” under Github/Golang, but I did not find any. There is almost no related issue under Windows.

Press F5 to debug:

Other reference

go – non-standard import in standard package windows – Stack Overflow:

Get Golang Packages – Golang China at Golang.org

Goerror: non-standard import “gopkg.in/yaml.v2” in standard package-stack Overflow

Novice help why can’t load the package I just want to do a little crawler code without syntax error – Go language Chinese-golang Chinese community

Go get failed -CSDN forum

Learn how to install packages manually from this: download third-party packages – Golang China