Sign in
go
/
website
/
249c6aeddfb3f505c11ee701ca7590f8d3e928af
/
.
/
_content
/
talks
/
2017
/
state-of-go-may
/
exec
/
main.go
blob: dced1d3637d5b33f638585f353bfe66f12f75676 [
file
] [
log
] [
blame
]
package main
import (
"log"
"os"
"os/exec"
)
func main() {
cmd := exec.Command("getenv", "foo")
cmd.Env = append(os.Environ(), "foo=newbar")
// HL
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatal(err)
}
}