Skip to content
Simple command execution for golang
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
process.go
process_test.go

README.md

sexec - Simple command execution library for golang Build Status GoDoc Coverage Status

sexec is a simple command execution library written in golang. It currently only works on linux.

Usage

$ go get github.com/blang/sexec

Note: Always vendor your dependencies or fix on a specific version tag.

import github.com/blang/sexec
p := sexec.NewProcess("while true; do echo test; sleep 1; done", os.Stdout, os.Stderr)
p.Start() // Start in background
p.Signal(syscall.SIGTERM) // Send signals
<- p.WaitCh() // Wait for exit
pid, err:=p.Pid()
code, err:=p.ExitCode()

Also check the GoDocs.

Why should I use this lib?

  • Simple
  • Fully tested (Coverage >90%)
  • Readable errors
  • Only Stdlib

Features

  • Exit Codes
  • Waiting via channel or method
  • Signalling

Motivation

I needed a simple lib to get ExitCodes and proper Signalling without the hassle around syscall.

Contribution

Feel free to make a pull request. For bigger changes create a issue first to discuss about it.

License

See LICENSE file.

You can’t perform that action at this time.