github.com/kubeshop/testkube@v1.17.23/contrib/executor/tracetest/pkg/command/command.go (about)

     1  package command
     2  
     3  import (
     4  	"bytes"
     5  	"os/exec"
     6  )
     7  
     8  func Run(command string, args ...string) ([]byte, error) {
     9  	cmd := exec.Command(command, args...)
    10  
    11  	var out bytes.Buffer
    12  	cmd.Stdout = &out
    13  
    14  	err := cmd.Run()
    15  
    16  	return out.Bytes(), err
    17  }