client/pkg/util/exec_unix.go

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
//go:build darwin || linux
// +build darwin linux

package util

import (
    "fmt"
    "os"
    "syscall"
)

func Exec(path string, args []string) error {
    args = append([]string{path}, args...)
    err := syscall.Exec(path, args, os.Environ())
    if err != nil {
        return fmt.Errorf("unable to exec path %q: %w", path, err)
    }

    return nil
}