The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
cgo Unix C code can't modify environment variables for Go
runtime: cgo Unix C code can't modify environment variables for Go
Sep 15, 2018
Maybe a "Known Issues" section on the cmd/cgo docs might work, linking to a relevant GitHub search? It already has some tidbits like "avoid passing uninitialized C memory to Go code if the Go code is going to store pointer values in it. Zero out the memory in C before passing it to Go.". I'm sure there are a few other cgo gotchas that should be documented.
On 15 Sep 2018, at 11:03, Ryan Hitchman ***@***.***> wrote:
Maybe a "Known Issues" section on the cmd/cgo docs might work, maybe linking to a relevant GitHub search? It already has some tidbits like "avoid passing uninitialized C memory to Go code if the Go code is going to store pointer values in it. Zero out the memory in C before passing it to Go.". I'm sure there are a few other cgo gotchas that should be documented.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
What version of Go are you using (
go version
)?1.11
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?linux amd64
What did you do?
Because of envOnce and copyenv in env_unix.go, linked non-Go programs can't set environment variables that are visible to Go code.
This is probably WAI, but it's surprising when embedding and could use a mention somewhere.
What did you see instead?
"1 1 3" instead of "1 2 3".
The text was updated successfully, but these errors were encountered: