- What version of Go are you using (
go version)?
go1.6.2
- What operating system and processor architecture are you using (
go env)?
darwin/amd64
- What did you do?
$ cat gen.go
package test
//go:generate echo $GOOS
$ GOOS=linux go generate gen.go
- What did you expect to see?
linux
- What did you see instead?
darwin
This issue was raised as #11438 and fixed in Go 1.5, but the fix for #13124 caused a regression of this behavior in Go 1.6.