You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go: C:\Program Files\Go\bin\go.exe: go version go1.23.4 windows/amd64
gopls: C:\Users\LoS\go\bin\gopls.exe (version: v0.17.1 built with go: go1.23.4)
gotests: not installed
gomodifytags: not installed
impl: not installed
goplay: not installed
dlv: C:\Users\LoS\go\bin\dlv.exe (version: v1.24.0 built with go: go1.23.4)
staticcheck: C:\Users\LoS\go\bin\staticcheck.exe (version: v0.5.1 built with go: go1.23.4)
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\LoS\AppData\Local\go-build
set GOENV=C:\Users\LoS\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\LoS\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\LoS\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.23.4
set GODEBUG=
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\LoS\AppData\Roaming\go\telemetry
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=c:\Users\LoS\go\gocaesarx\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 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\LoS\AppData\Local\Temp\go-build3728956750=/tmp/go-build -gno-record-gcc-switches
Describe the bug
When trying to run ANY of the tests the go.exe test command is run by the IDE and a few moments later the linker throws out an error not package main so ALL tests fail.
I know, someone will be quick to say that my tests are wrong or that they are failing. Well, no. I had this project in VSCodium prior to installing VSCode and all is fine. I have no problems running Go apps or Go tests in VSCodium once I installed the Go Extension. But on VSCode it just doesn't seem to work. I don't know what else is missing.
Steps to reproduce the behavior:
Open the folder that contains the Go project module mymodule(unit tests are in the mymodule/tests folder and have package name mymodule_test
Wait for the environment setup to complete
Go to the Test tab on the left panel
Select any test and run it
The error that appears is
BLAH BLAH BLAH: not package main
FAIL gocaesarx/tests [build failed]
The text was updated successfully, but these errors were encountered:
@lordofscripts what happens when you copy the exact test invocation from the test output, and run it from the VS Code integrated terminal? Do you get the same error?
This doesn't seem to be a widespread problem, so is likely related to the VS Code environment or your Go install. Running in the VS Code terminal will help narrow that down.
What version of Go, VS Code & VS Code Go extension are you using?
Version: 1.97.2 (user setup) Commit: e54c774e0add60467559eb0d1e229c6452cf8447 Date: 2025-02-12T23:20:35.343Z Electron: 32.2.7 ElectronBuildId: 10982180 Chromium: 128.0.6613.186 Node.js: 20.18.1 V8: 12.8.374.38-electron.0 OS: Windows_NT x64 10.0.19045
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Tools Configuration
Environment
GOBIN: undefined
toolsGopath:
gopath: C:\Users\LoS\go
GOROOT: C:\Program Files\Go
PATH: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Go\bin;C:\Program Files\VSCodium\bin;C:\Users\LoS\AppData\Local\Microsoft\WindowsApps;C:\Users\LoS\go\bin
Tools
Go env
Workspace Folder (gocaesarx): c:\Users\LoS\go\gocaesarx
Describe the bug
When trying to run ANY of the tests the
go.exe test
command is run by the IDE and a few moments later the linker throws out an errornot package main
so ALL tests fail.I know, someone will be quick to say that my tests are wrong or that they are failing. Well, no. I had this project in VSCodium prior to installing VSCode and all is fine. I have no problems running Go apps or Go tests in VSCodium once I installed the Go Extension. But on VSCode it just doesn't seem to work. I don't know what else is missing.
Steps to reproduce the behavior:
mymodule
(unit tests are in themymodule/tests
folder and have package namemymodule_test
The error that appears is
The text was updated successfully, but these errors were encountered: