pomerium/integration/internal/cluster/cmd_notlinux.go
bobby 1565d25d32
ci: use go 1.17.x (#2492)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
2021-08-19 21:13:36 -07:00

21 lines
350 B
Go

//go:build !linux
// +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
}