An open API service indexing awesome lists of open source software.

https://github.com/jasonmccallister/process

A simple Go module designed to make running external processes easier
https://github.com/jasonmccallister/process

go process-management

Last synced: 6 days ago
JSON representation

A simple Go module designed to make running external processes easier

Awesome Lists containing this project

README

          

# Process

A simple Go module designed to make running external processes easier.

## Installation

```bash
go get github.com/jasonmccallister/process
```

## Usage

```go
package main

import (
"log"
"net/http"
"os"

"github.com/jasonmccallister/process"
)

func main() {
// start one process
go func() {
if err := process.Start(process.Opts{
Name: "echo",
Args: []string{"Hello"},
Writer: os.Stdout,
ErrWriter: os.Stderr,
}); err != nil {
log.Fatal(err)
}

if err := process.Start(process.Opts{
Name: "echo",
Args: []string{"world"},
Writer: os.Stdout,
ErrWriter: os.Stderr,
}); err != nil {
log.Fatal(err)
}
}()

// another blocking call such as a web server
if err := http.ListenAndServe(":8888", nil); err != nil {
log.Fatal(err)
}
}
```