mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-02 03:46:29 +02:00
20 lines
332 B
Go
20 lines
332 B
Go
// +build !linux
|
|
|
|
package cluster
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
|
|
"github.com/onsi/gocleanup"
|
|
)
|
|
|
|
func commandContext(ctx context.Context, name string, args ...string) *exec.Cmd {
|
|
cmd := exec.CommandContext(ctx, name, args...)
|
|
gocleanup.Register(func() {
|
|
if cmd.Process != nil {
|
|
_ = cmd.Process.Kill()
|
|
}
|
|
})
|
|
return cmd
|
|
}
|