Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/briansorahan/death

A tiny package that catalogs the myriad ways you might want to kill a Go program.
https://github.com/briansorahan/death

Last synced: 18 days ago
JSON representation

A tiny package that catalogs the myriad ways you might want to kill a Go program.

Awesome Lists containing this project

README

        

# death

Package death provides some functions that I find myself writing over and over again in Go programs.

## Install

```
go get -u github.com/briansorahan/death
```

## Usage

### In func main

This is not working code, but should serve to illustrate how I expect `Main` to be used:

```
package main

import (
"github.com/briansorahan/death"
)

func main() {
cli, err := NewCLI()

death.Main(err)

death.Main(cli.Run(context.Background()))
}
```

### In testing

```
package mypkg

import (
"testing"

"github.com/briansorahan/death"
)

func TestMyFunc(t *testing.T) {
die := death.By(t)

die(MyFunc())
}
```