Skip to content

A package for running subprocesses in Go, similar to Python's subprocesses package.

License

Notifications You must be signed in to change notification settings

estebangarcia21/subprocess

Repository files navigation

Subprocesses

Spawn subprocesses in Go.

go get -u "github.com/estebangarcia21/subprocess"

Sanitized mode

package main

import (
	"log"

	"github.com/estebangarcia21/subprocess"
)

func main() {
	s := subprocess.New("ls", subprocess.Arg("-lh"))

	if err := s.Exec(); err != nil {
		log.Fatal(err)
	}
}

Shell mode

package main

import (
	"log"

	"github.com/estebangarcia21/subprocess"
)

func main() {
	s := subprocess.New("ls -lh", subprocess.Shell)

	if err := s.Exec(); err != nil {
		log.Fatal(err)
	}
}

About

A package for running subprocesses in Go, similar to Python's subprocesses package.

Topics

Resources

License

Stars

Watchers

Forks