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

runtime: environment variable GODEBUG (possibly others) treated case sensitively on Windows. #28557

Zyl9393 opened this issue Nov 2, 2018 · 1 comment


Copy link

@Zyl9393 Zyl9393 commented Nov 2, 2018

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


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

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Zyl\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\Projects\Code\Go
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set GOMOD=
set CGO_CFLAGS=-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\Zyl\AppData\Local\Temp\go-build244566434=/tmp/go-build -gno-record-gcc-switches

What did you do?

  • Open a console window.
  • SET godebug=cgocheck=0
  • Run my program, wherein I check that os.GetEnv("GODEBUG") contains "cgocheck=0". (Currently mandatory to be able to use OpenGL bindings at all; see these issues: go-gl/gl#80, go-gl/glow#63)
  • Correctly, receive the string "cgocheck=0". (since environment variables are case-insensitive on Windows)

What did you expect to see?

My program executing normally.

What did you see instead?

panic: runtime error: cgo argument has Go pointer to Go pointer.
I am unable to predict this, since what os.GetEnv() correctly reports mismatches what Go sees internally.

What did you try to fix it?

Open a new console window, wherein I SET GODEBUG=cgocheck=0, followed by execution of my program, which resulted in the expected behaviour, despite Windows environment variables supposedly being case-insensitive.

@bradfitz bradfitz changed the title Environment variable GODEBUG (possibly others) treated case sensitively on Windows. runtime: environment variable GODEBUG (possibly others) treated case sensitively on Windows. Nov 2, 2018
@bradfitz bradfitz added this to the Unplanned milestone Nov 2, 2018
Copy link

@gopherbot gopherbot commented Nov 2, 2018

Change mentions this issue: runtime: look up runtime env variables case insensitively on Windows

@gopherbot gopherbot closed this in f08352b Nov 2, 2018
@golang golang locked and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.