Go version
go version go1.24.4 windows/amd64,Windows 11 23H2 22631.5624
Output of go env
in your module/workspace:
set AR=ar
set CC=gcc
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_ENABLED=0
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=on
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=C:\Users\Administrator\AppData\Local\go-build
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\Administrator\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\Administrator\AppData\Local\Temp\go-build1624433581=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=D:\WorkCode\Project\demo\go.mod
set GOMODCACHE=D:\Soft\Environment\Go\workspace\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\Soft\Environment\Go\workspace
set GOPRIVATE=
set GOPROXY=https://mirrors.aliyun.com/goproxy/,direct
set GOROOT=D:\Soft\Compiler\Go
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\Administrator\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=D:\Soft\Compiler\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.24.4
set GOWORK=
set PKG_CONFIG=pkg-config
What did you do?
I’m wondering if this could be a compatibility issue between the updated Windows version and Go. Has anyone else encountered similar behavior after a Windows update? Any insights or fixes would be appreciated.
This version includes key details (timeline with the update, minimal reproducible code, environment info, and specific symptoms) to help the community diagnose the issue.
What did you see happen?
When I run the simple Go program using go run demo.go (either in VS Code's integrated terminal or Windows PowerShell), here's the full output I see:
plaintext
[Running] go run "d:\WorkCode\Project\QKDSim\demo\demo0\demo.go"
2222
[Done] exited with code=0 in 75.077 seconds
What did you expect to see?
I expected the program to exit immediately after printing "2222", with a total execution time of less than 1 second—consistent with how it behaved before the Windows forced update.
The current output is incorrect because:
The program contains no logic that would justify a 75-second delay. It is a minimal, single-file program with only a fmt.Println("2222") in main()—no loops, sleeps, I/O operations, network calls, or goroutines that could block or prolong execution. The delay occurs after the program’s core logic (printing "2222") completes, suggesting an issue with the final steps of execution (e.g., process cleanup, resource release, or interaction with the updated OS environment) rather than the program’s code itself.
Additional context:
The code has not been modified between pre- and post-update tests—only the Windows system was updated. Testing in both VS Code’s integrated terminal and Windows PowerShell yields the same delayed exit, ruling out terminal-specific quirks. Running go build demo.go and executing the compiled binary directly (instead of go run) also results in the 75-second delay before exit, confirming the issue persists beyond the go run command’s compilation step. No other system processes appear to be hogging resources during execution (CPU, memory, and disk usage remain low).
This suggests a potential compatibility issue between Go’s runtime/process handling and the updated Windows environment, where the OS update may have altered how processes terminate or release resources.
Comment From: gabyhelp
Related Issues
- cmd/go: go run hangs for a few minutes from windows command line #22055 (closed)
- cmd/go: long tests failing on Windows #25300 (closed)
- runtime: hangs on windows with golang >= 1.14 #48059
- go run takes too long to execute #50459 (closed)
- go: slow exit of a network-using binary built with go 1.21rc3 and the race detector #61655 (closed)
- Go Hello World Program taking too long to run #40374 (closed)
- os/exec: sometimes Run doesn't return even though the process has finished #59055 (closed)
- cmd/go: cache results of exec.LookPath #36768 (closed)
- affected/package: #57137 (closed)
- Can differed calls run after runtime.Goexit() in a given goroutine ? thanks #43952 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: ALTree
I've seen this happen a few times due to a nosy antivirus. You could try: disabling the antivirus, whitelisting the folder where you go build
and launch the binary, and trying to update the antivirus and virus definitions to the latest version.
Comment From: seankhliao
https://golang.org/doc/faq#virus