sigtx [](https://travis-ci.org/markbates/sigtx)

September 13, 2017 ยท View on GitHub

This package provides an implementation proposal for this Go proposal: https://github.com/golang/go/issues/21521.

Usage

package main

import (
	"context"
	"fmt"
  "os"
  "syscall"

	"github.com/markbates/sigtx"
)

func main() {
	ctx, cancel := sigtx.WithCancel(context.Background(), os.Interrupt, syscall.SIGTERM, syscall.SIGKILL)
	defer cancel()
	select {
	case <-ctx.Done():
		fmt.Println("thanks for stopping me")
	}
}