Command returns the Cmd struct to execute the named program with the given arguments.
package main import ( "log" "os" "os/exec" ) func main() { cmd := exec.Command("prog") cmd.Env = append(os.Environ(), "FOO=duplicate_value", // ignored "FOO=actual_value", // this value is used ) if err := cmd.Run(); err != nil { log.Fatal(err) } }