Skip to content

markbates/sigtx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sigtx Build Status

This package provides an implementation proposal for this Go proposal: golang/go#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")
	}
}

About

a context implementation for signal capturing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages