Skip to content

os: Getwd returns wrong path format in MinGW #43944

@enihcam

Description

@enihcam

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

$ go version
go1.15.7 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
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\guest\AppData\Local\go-build
set GOENV=C:\Users\guest\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\guest\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\guest\go
set GOPRIVATE=
set GOPROXY=
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\guest\AppData\Local\Temp\go-build066057222=/tmp/go-build -gno-record-gcc-switches

What did you do?

run exec.Command(filepath.Join(os.Getwd(), 'app') under:

~ $ uname -a
MINGW64_NT-10.0-17763 dell 3.1.7-340.x86_64 2020-10-23 13:08 UTC x86_64 Msys
~ $ pwd
/c/Users/guest

What did you expect to see?

app output

What did you see instead?

exec: "C:\\Users\\guest\\app": file does not exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Windows

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions