4

I have installed Golang and VS code and when i'm trying to debug the code using F5, i'm getting below error on debug console. I also tried to switch debug-adapter to legacy but still no luck. Is there anything being missed in setup

Starting: C:\Suresh\Project\GoWorkspace\bin\dlv.exe dap --check-go-version=false --check-go-version=false --listen=127.0.0.1:56713 from C:\Suresh\Project\GoWorkspace\src\movies-data-api/cmd/api
DAP server listening at: 127.0.0.1:56713
connection error: Error: read ECONNRESET
dlv dap (12724) exited with code: 3221226528

enter image description here

Also when switched "debugAdapter": "legacy", then got below error enter image description here

Both the solution didn't work for me. Here is my launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}/cmd/api/main.go",
            "debugAdapter": "dlv-dap",
            "env": {"TIER" : "development"},
            "args": [],
            "cwd": "${workspaceFolder}",
            "dlvFlags": ["--check-go-version=false"]
        }
    ]
}

Here is go env

set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\suresh.rajput\AppData\Local\go-build
set GOENV=C:\Users\suresh.rajput\AppData\Roaming\go\env  
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Suresh\Project\GoWorkspace\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Suresh\Project\GoWorkspace
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.19.1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Suresh\Project\GoWorkspace\src\movies-data-api\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\SURESH~1.RAJ\AppData\Local\Temp\go-build90496803=/tmp/go-build -gno-record-gcc-switches
suresh rajput
  • 169
  • 2
  • 9

0 Answers0