What version of Go are you using (go version)?
$ go version
go version go1.16.13 windows/amd64
Does this issue reproduce with the latest release?
- Go 1.17.6: No
- Go 1.16.13: Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\runneradmin\AppData\Local\go-build
set GOENV=C:\Users\runneradmin\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\runneradmin\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\runneradmin\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\hostedtoolcache\windows\go\1.16.13\x64
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\hostedtoolcache\windows\go\1.16.13\x64\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.16.13
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
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 -fmessage-length=0 -fdebug-prefix-map=C:\Users\RUNNER~1\AppData\Local\Temp\go-build10994681=/tmp/go-build -gno-record-gcc-switches
What did you do?
package main
import "testing"
func TestTempDir(t *testing.T) {
tests := []struct {
name string
}{
{
name: "**aaa",
},
{
name: "bbb**",
},
{
name: "**aaa bbb**",
},
{
name: "subdir/**",
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.TempDir()
})
}
}
What did you expect to see?
=== RUN TestTempDir
--- PASS: TestTempDir (0.00s)
=== RUN TestTempDir/**aaa
--- PASS: TestTempDir/**aaa (0.00s)
=== RUN TestTempDir/bbb**
--- PASS: TestTempDir/bbb** (0.00s)
=== RUN TestTempDir/**aaa_bbb**
--- PASS: TestTempDir/**aaa_bbb** (0.00s)
=== RUN TestTempDir/subdir/**
--- PASS: TestTempDir/subdir/** (0.00s)
PASS
What did you see instead?
--- FAIL: TestTempDir (0.00s)
--- FAIL: TestTempDir/**aaa (0.00s)
main_test.go:25: TempDir: mkdir C:\Users\RUNNER~1\AppData\Local\Temp\TestTempDir_*1134522990aaa: The filename, directory name, or volume label syntax is incorrect.
--- FAIL: TestTempDir/bbb** (0.00s)
main_test.go:25: TempDir: mkdir C:\Users\RUNNER~1\AppData\Local\Temp\TestTempDir_bbb*1840932692: The filename, directory name, or volume label syntax is incorrect.
--- FAIL: TestTempDir/**aaa_bbb** (0.00s)
main_test.go:25: TempDir: mkdir C:\Users\RUNNER~1\AppData\Local\Temp\TestTempDir_**aaa_bbb*2013955203: The filename, directory name, or volume label syntax is incorrect.
--- FAIL: TestTempDir/subdir/** (0.00s)
main_test.go:25: TempDir: mkdir C:\Users\RUNNER~1\AppData\Local\Temp\TestTempDir_subdir_*1630578384: The filename, directory name, or volume label syntax is incorrect.
FAIL
FAIL tempdir 0.020s
FAIL
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
What did you expect to see?
What did you see instead?