Go version
go version go1.27-devel_eae0bfb1b0 Tue Mar 24 18:31:08 2026 -0700 windows/amd64
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=1
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=C:\Users\User\AppData\Local\go-build
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\User\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\User\AppData\Local\Temp\go-build1125092470=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=C:\Users\User\src\go\src\go.mod
set GOMODCACHE=C:\Users\User\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\User\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\User\src\go
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\User\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Users\User\src\go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.27-devel_eae0bfb1b0 Tue Mar 24 18:31:08 2026 -0700
set GOWORK=
set PKG_CONFIG=pkg-config
What did you do?
I opened simple cmd.exe command prompt, Then I run go test os -short command.
What did you see happen?
I see these errors
C:\Users\User\src\go\src>go test os -short
--- FAIL: TestRootOpen_File (0.15s)
--- FAIL: TestRootOpen_File/symlink (0.00s)
root_test.go:79: symlink target C:\Users\User\AppData\Local\Temp\TestRootOpen_Filesymlink2955299547\001/ROOT/link: A required privilege is not held by the client.
--- FAIL: TestRootOpen_File/symlink_dotdot_slash (0.00s)
root_test.go:79: symlink ..\ C:\Users\User\AppData\Local\Temp\TestRootOpen_Filesymlink_dotdot_slash3556201502\001/ROOT/link: A required privilege is not held by the client.
--- FAIL: TestRootOpen_File/symlink_ending_in_slash (0.01s)
root_test.go:79: symlink dir\ C:\Users\User\AppData\Local\Temp\TestRootOpen_Filesymlink_ending_in_slash933062249\001/ROOT/link: A required privilege is not held by the client.
... I see many more error lines
... I see many more error lines
... I see many more error lines
FAIL os 19.908s
FAIL
C:\Users\User\src\go\src>
What did you expect to see?
I expected to see no errors. Similar to
C:\Users\User\src\go\src>go test os -short
ok os 107.481s
C:\Users\User\src\go\src>
For example, I see no errors if I start cmd.exe command as Administrator. I expect normal cmd.exe should not fail too, because most Windows users and developers do not run their cmd.exe as Administrator.
I did not check other packages, but os.
I am also surprised that this bug has not been caught by our builders. It means that all our builders run tests as Administrator. I suspect majority of users run all programs as themselves. Our builders should do the same.
Go version
go version go1.27-devel_eae0bfb1b0 Tue Mar 24 18:31:08 2026 -0700 windows/amd64
Output of
go envin your module/workspace:What did you do?
I opened simple cmd.exe command prompt, Then I run
go test os -shortcommand.What did you see happen?
I see these errors
What did you expect to see?
I expected to see no errors. Similar to
For example, I see no errors if I start cmd.exe command as Administrator. I expect normal cmd.exe should not fail too, because most Windows users and developers do not run their cmd.exe as Administrator.
I did not check other packages, but
os.I am also surprised that this bug has not been caught by our builders. It means that all our builders run tests as Administrator. I suspect majority of users run all programs as themselves. Our builders should do the same.