Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: TempDir mistakenly removes \ in C:\ #29291

Closed
alexbrainman opened this issue Dec 16, 2018 · 1 comment
Closed

os: TempDir mistakenly removes \ in C:\ #29291

alexbrainman opened this issue Dec 16, 2018 · 1 comment

Comments

@alexbrainman
Copy link
Member

@alexbrainman alexbrainman commented Dec 16, 2018

What version of Go are you using (go version)?

go version devel +26985ed4a5 Sat Dec 15 04:18:21 2018 +0000 windows/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Alex\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=c:\users\alex\dev
set GOPROXY=
set GORACE=
set GOROOT=c:\users\alex\dev\go
set GOTMPDIR=
set GOTOOLDIR=c:\users\alex\dev\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
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\Alex\AppData\Local\Temp\go-build672692694=/tmp/go-build -gno-record-gcc-switches

What did you do?

I set my TMP directory to Z:\

I used this command:

set TMP=Z:\

Then I built and run this program https://play.golang.org/p/8FXtRPXiQar

What did you expect to see?

Z:\

What did you see instead?

Z:

My comments

Removing last \ is wrong, because Z:\ is root directory on Z:, while Z: is current directory on Z:.

Probably, not common to use root directory for TMP. But, if setup this way, I can see how os.TempDir will bring confusion and chaos in my program.

Alex

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 17, 2018

Change https://golang.org/cl/154384 mentions this issue: os: adjust TempDir for Z:\

@bcmills bcmills added this to the Go1.12 milestone Dec 19, 2018
@gopherbot gopherbot closed this in 49abcf1 Dec 20, 2018
@golang golang locked and limited conversation to collaborators Dec 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.