WithEnv sets the environment for subsequent [Pipe.Exec] and [Pipe.ExecForEach] commands to the string slice env, using the same format as [os/exec.Cmd.Env]. An empty slice unsets all existing environment variables.
(env []string)
| 967 | // commands to the string slice env, using the same format as [os/exec.Cmd.Env]. |
| 968 | // An empty slice unsets all existing environment variables. |
| 969 | func (p *Pipe) WithEnv(env []string) *Pipe { |
| 970 | p.mu.Lock() |
| 971 | defer p.mu.Unlock() |
| 972 | p.env = env |
| 973 | return p |
| 974 | } |
| 975 | |
| 976 | // WithError sets the error err on the pipe. |
| 977 | func (p *Pipe) WithError(err error) *Pipe { |
no outgoing calls