Skip to content

EugenMayer/go-exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WAT

Simplify command execution on the shell even more to get you a one-liner with stdout/stderr capturing (/exec) Advanced topic, introduce a command/strategy patter to abstract if want to run a command locally/remote using ssh/on a docker container (/runnte/)

Usage

See the examples at go-shell-cli-quickstarter

package mystuff

import (
	"github.com/eugenmayer/go-exec/exec"
)


if stdout, stderr, err := exec.Run("echo hi", true); err != nil {
    log.Print(stdout)
    log.Print(stderr)
    log.Fatal(err)
}

if stdout, stderr, err := exec.Run("echo ho", true); err != nil {
    log.Print(stdout)
    log.Print(stderr)
    log.Fatal(err)
}

// continue..

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published