exec.Command("GOOS=windows", "go", "build", ".")
Output:
cmd.Run() failed with exec: "GOOS=windows": executable file not found in $PATH
exec.Command("bash", "-c", "GOOS=windows", "go", "build", ".")
cmd := exec.Command("go", "build", ".")
cmd.Env = os.Environ()
cmd.Env = append(cmd.Env, "GOOS=windows")