Weird GOBIN Bug on Windows

I’ve found a weird GOBIN bug on Windows. It’s stripping out the backslashes in the path and I don’t know how to stop it.

set GOBIN=C:UsersamunnellyTECHGobin
set GOPATH=C:\Users\amunnelly\TECH\Go

I’ve uninstalled and reinstalled Go. I’ve set a GOBIN environment variable, and I’ve tried setting GOBIN with double backslashes. Nothing doing. This is the full result of go env

set GO111MODULE=
set GOARCH=amd64
set GOBIN=C:UsersamunnellyTECHGobin
set GOCACHE=C:\Users\amunnelly\AppData\Local\go-build
set GOENV=C:\Users\amunnelly\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\amunnelly\TECH\Go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
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=
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\AMUNNE~1\AppData\Local\Temp\go-build046813146=/tmp/go-build -gno-record-gcc-switches

Any thoughts or advice most gratefully accepted.

Thanks for getting back to me Eric. I think you might have spotted the issue. I’ve been running my code in the Visual Studio Code editor, which has a bash terminal. I never explicitly set a GOBIN variable, but it may have been set by some process running in that VS Code bash terminal.

I’m going to think about this some more. The whole reason I was changing back and forth was that I was trying to use Go modules but it seems there’s some conflict between programs that exist along the go path and those that can use this go modules dependency tracking. I might be better served by reading those docs a little more carefully instead of bashing about and hoping things come right in the end.

Thanks again for helping me out.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.