5

So I installed VSCODE on my windows machine as my main golang IDE and I guess my overall lack of go knowledge is making me experience this seemingly unsolvable error: I installed delve and wanted to use it as my debugger in vscode-go. I did everything as mentioned in the readme on https://github.com/Microsoft/vscode-go , yet for some reason when I run dlv debug I get error "can't load package: package internal: no buildable Go source files in c:\go\src\internal exit status 1". I couldn't find anything related to this folder on the internet, but I have never myself entered the path to src/internal in any of the config files. So this is making me really confused, since I thought if it was a common folder someone should have atleast gotten the same error once.

It occurs both in the vscode and in command prompt, also if dlv test is run. I also know it is not the issue with my folder structure/env variables since it complains about my package files missing too if I remove them in addition to also giving the same c:\go\src\internal error. It seems as if there is a setting somewhere to check that folder for source files too, but I can't find the setting and the dlv debug crashes after giving me the error.

Gama11
  • 31,714
  • 9
  • 78
  • 100
grssn
  • 526
  • 6
  • 8
  • "internal" is a reserved package name. Are you trying to import a package named "internal" in your code? – JimB Sep 12 '16 at 21:52
  • Looks like the same [problem](https://stackoverflow.com/questions/39456064/remote-debugging-with-volume-panicks) I have. I suspect it to be within VsCode. – Chris G. Sep 13 '16 at 16:59

5 Answers5

6

Got same issue with latest delve and vscode:

can't load package: package internal: no buildable Go source files in C:\Coding\Go\src\internal

and 'go build' working without any errors

Have to fallback to previous version of delve to get it working. It seems delve broke something or just need to update some things. Seems it enough just to replace dlv.exe in %GOPATH%\bin folder. I'm not sharing my version because it exe, but you can find it or build from sources

Sunnyque
  • 114
  • 1
  • 3
  • 5
    Thank you :) I sucessfully executed these steps in `go/src/github.com/derekparker/delve` after regular go get: `git checkout e4c7df`then `go install github.com/derekparker/delve/cmd/dlv` – runec Sep 13 '16 at 11:15
  • Thanks. This seems to be the case. I'll try rebuilding from source when I get home. – grssn Sep 13 '16 at 11:18
  • 1
    Thanks @runec. Working properly! – Icebob Sep 21 '16 at 08:01
3

I solved my problem that looks like same problem by changing launch.json file.

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

// after changing 
"program": "${workspaceRoot}/src/github.com/myproje/hello",
Ali Altun
  • 397
  • 5
  • 14
2

I had the same problem. When i check, {fileDirName} points my .vscode folder. So i've just given my path manuelly and it works.

I've replaced this

"program": "${fileDirname}"

with this

"program": "c:/Go/src/MyGoProject"
Furkan Öztürk
  • 1,178
  • 11
  • 24
1

same problem (vscode/linux/go1.8) The Solution:

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

If Go is installed correctly, this error message is saying you are trying to import an external package called "internal"

Compile an empty program with no imports to see if the issue persists eg.

package main

func main() {
}

You should not see any errors here. If you do then that is most likely an indication Go is not installed properly.

nosequeldeebee
  • 935
  • 9
  • 14