github.com/paketo-buildpacks/packit@v1.3.2-0.20211206231111-86b75c657449/pexec/doc.go (about)

     1  // Package pexec provides a mechanism for invoking a program executable with a
     2  // varying set of arguments.
     3  //
     4  // Below is an example showing how you might invoke the `echo` executable with arguments;
     5  //
     6  //   package main
     7  //
     8  //   import (
     9  //   	"os"
    10  //
    11  //   	"github.com/paketo-buildpacks/packit/pexec"
    12  //   )
    13  //
    14  //   func main() {
    15  //   	echo := pexec.NewExecutable("echo")
    16  //
    17  //   	err := echo.Execute(pexec.Execution{
    18  //   		Args:   []string{"hello from pexec"},
    19  //   		Stdout: os.Stdout,
    20  //   	})
    21  //   	if err != nil {
    22  //   		panic(err)
    23  //   	}
    24  //
    25  //   	// Output: hello from pexec
    26  //   }
    27  //
    28  package pexec