How to fix the error "cannot download the package: internal"

So, I installed VSCODE on my Windows machine as my main golang IDE, and I assume that my general lack of knowledge makes me experience this seemingly insoluble error: I installed delve and wanted to use it as my debugger in vscode -go. I did everything mentioned in readme at https://github.com/Microsoft/vscode-go, but for some reason, when I run dlv debug, I get the error "cannot load package: internal package: there are no built-in Go source files in the directory c: \ go \ src \ internal exit status 1". I could not find anything related to this folder on the Internet, but I myself never entered the path to src / internal in any of the configuration files. So it bothers me, since I thought it was a shared folder that someone should at least get the same error.

This happens both in vscode and on the command line, also if dlv test is running. I also know that this is not a problem with my folder structure / env variables, as it complains about my package files, which are also missing if I delete them in addition to the same as the internal error c: \ go \ src \ . It seems that there is a parameter somewhere to check this folder for source files too, but I can not find the settings and debug dlv after I gave the error.

+4
source share
4 answers

You have the same problem with the latest versions of delve and vscode:

unable to download package: internal package: no embedded source files Go C: \ Coding \ Go \ SRC \ internal

'go build'

delve, . , - - - . , dlv.exe % GOPATH%\bin. , exe,

+6

, , launch.json.

// before
"program": "${workspaceRoot}

// after changing 
"program": "${workspaceRoot}/src/github.com/myproje/hello",
+2

(vscode/linux/go1.8) :

change in launch.json > 
 "program": "${fileDirname}"
+1

Go , , ""

, , , .

package main

func main() {
}

There should not be any errors. If you do this, it most likely indicates that Go is not installed correctly.

0
source

Source: https://habr.com/ru/post/1654391/


All Articles