-
Notifications
You must be signed in to change notification settings - Fork 819
Description
For asking questions, see:
Before filing an issue, please review our troubleshooting guides
Please answer these questions before submitting your issue. Thanks!
What version of Go, VS Code & VS Code Go extension are you using?
- Run
go version
to get version of Go from the VS Code integrated terminal.- go version go1.16.7 linux/amd64
- Run
gopls -v version
to get version of Gopls from the VS Code integrated terminal.- Build info
golang.org/x/tools/gopls v0.7.1
golang.org/x/tools/[email protected] h1:Mh3Z8Xcoq3Zy7ksSlwDV/nzQSbjFf06A+L+F8YHq55U=
github.com/BurntSushi/[email protected] h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/google/[email protected] h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/[email protected] h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/[email protected] h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/[email protected] h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
golang.org/x/[email protected] h1:ZC/gVBZl8poJyKzWLxxlsmhayVGosF4mohR35szD5Bg=
golang.org/x/[email protected] h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
honnef.co/go/[email protected] h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE=
mvdan.cc/[email protected] h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
mvdan.cc/xurls/[email protected] h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
- Build info
- Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.- 1.59.0
379476f0e13988d90fab105c5c19e7abc8b1dea8
x64
- 1.59.0
- Check your installed extensions to get the version of the VS Code Go extension
- v0.27.0
- Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.
Share the Go related settings you have added/edited
Run Preferences: Open Settings (JSON)
command to open your settings.json file.
Share all the settings with the go.
or ["go"]
or gopls
prefixes.
Describe the bug
When I use go mod init to initialize a module and write a simple main.go file, set a breakpoint at will, and then press F5 to start debugging. The console output:
Starting: /home/xxx/go/bin/dlv-dap dap --listen=127.0.0.1:11031 --log=true --log-dest=3
DAP server listening at: 127.0.0.1:11031
Build Error: go build -o /data00/home/xxx/go/src/xxx/tdebug/__debug_bin -gcflags all=-N -l /home/xx/go/src/xxx/tdebug
directory /home/xxx/go/src/xxx/tdebug outside available modules (exit status 1).
But when i execute this command manually(go build -o .....), the execution was successful and the file "__debug_bin" was generated.
Then i change the mode from "auto" to "exec" and specify the path of "__debug_bin", the debugging can start.
Steps to reproduce the behavior:
- mkdir tdebug && cd tdebug
- go mod init tdebug
- write a main.go just contains print "hello world" and make a breakpoint
- F5 to start debug
- the error occurred