1. What version of Go are you using (`go version`)? go1.6.2 2. What operating system and processor architecture are you using (`go env`)? darwin/amd64 3. What did you do? ``` $ cat gen.go package test //go:generate echo $GOOS $ GOOS=linux go generate gen.go ``` 1. What did you expect to see? `linux` 2. 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.