Skip to content

Build Error: go build -o F:\....\debug_bin.exe -gcflags all=-N -l . no Go files in F:\....\ (exit status 1) #2779

@John-zhan

Description

@John-zhan

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go.1.20.3
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • No gopls
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.78.2
      b3e4e68a0bc097f0ae7907b217c1119af9e03435
      x64
      • No code-insiders
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.38.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.

Checking configured tools....
GOBIN: undefined
toolsGopath:
gopath: F:\personalFile\GoCode
GOROOT: D:\GoLang
go: D:\GoLang\bin\go.exe: go version go1.20.3 windows/amd64
gotests: F:\personalFile\GoCode\bin\gotests.exe (version: v1.6.0 built with go: go1.20.3)
gomodifytags: F:\personalFile\GoCode\bin\gomodifytags.exe (version: v1.16.0 built with go: go1.20.3)
impl: F:\personalFile\GoCode\bin\impl.exe (version: v1.1.0 built with go: go1.20.3)
goplay: F:\personalFile\GoCode\bin\goplay.exe (version: v1.0.0 built with go: go1.20.3)
dlv: F:\personalFile\GoCode\bin\dlv.exe (version: v1.20.2 built with go: go1.20.3)
staticcheck: F:\personalFile\GoCode\bin\staticcheck.exe (version: v0.4.3 built with go: go1.20.3)
gopls: F:\personalFile\GoCode\bin\gopls.exe (version: v0.11.0 built with go: go1.20.3)
go env
Workspace Folder (Xray-core): f:\personalFile\mycode
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\NathanialPC\AppData\Local\go-build
set GOENV=C:\Users\NathanialPC\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=F:\personalFile\GoCode\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=F:\personalFile\GoCode
set GOPRIVATE=
set GOROOT=D:\GoLang
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\GoLang\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.3
set GCCGO=gccgo
set GOAMD64=v3
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=f:\personalFile\mycode\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\NATHAN~1\AppData\Local\Temp\go-build4130307436=/tmp/go-build -gno-record-gcc-switches

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

this is my config.json

"version": "0.2.0",

"configurations": [
    {
        "name": "Launch",
        "type": "go",
        "request": "launch",
        "mode": "auto",
        "program":  "${workspaceRoot}",
        "cwd": "${workspaceRoot}",
        "logOutput": "dap",
        "showLog": true,
        "hideSystemGoroutines": true,
    }
]

I have a project, and it have the go.mod. Now I can execute "go build" build my project, but when I debug this project by vscode, prompt occurs :
Build Error: go build -o F:....\debug_bin.exe -gcflags all=-N -l . no Go files in F:....\ (exit status 1)

Steps to reproduce the behavior:

  1. Go to 'run & debug'
  2. Click on 'F5'
  3. See error

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions