<commit_before>This package provide handling exit signals (SIGKILL, SIGTERM, SIGQUIT and Interrupt)

It's not difficult to write, just dead simple to use)  

## Installation
```go get -u gopkg.in/cheggaaa/go-exit.v1```

#### Simple example

```go
package main

import (
	"fmt"
	
	"gopkg.in/cheggaaa/go-exit.v1"
)

func main() {
	// start app in other goroutine
	go myAppStart()

	// wait stop signal
	sig := exit.Wait()
	fmt.Printf("'%v' recieved\n", sig)

	// and do app exit
	myAppStop()
}

// start your app here
func myAppStart() {
	fmt.Println("my app start")
	fmt.Println("send 'kill pid' or press Ctrl+C for exit")
}

func myAppStop() {
	// Do something for exit 
	fmt.Println("my app stop")
}

```

#### Advanced example

```go
package main

import (
	"fmt"
	"os"
	"syscall"
	"time"
	
	"gopkg.in/cheggaaa/go-exit.v1"
)

func main() {
	// we can enable http profiling ("net/http/pprof")<commit_msg>change import path in readme<commit_after>This package provide handling exit signals (SIGKILL, SIGTERM, SIGQUIT and Interrupt)

It's not difficult to write, just dead simple to use)  

## Installation
```go get -u github.com/cheggaaa/go-exit```

#### Simple example

```go
package main

import (
	"fmt"
	
	"github.com/cheggaaa/go-exit"
)

func main() {
	// start app in other goroutine
	go myAppStart()

	// wait stop signal
	sig := exit.Wait()
	fmt.Printf("'%v' recieved\n", sig)

	// and do app exit
	myAppStop()
}

// start your app here
func myAppStart() {
	fmt.Println("my app start")
	fmt.Println("send 'kill pid' or press Ctrl+C for exit")
}

func myAppStop() {
	// Do something for exit 
	fmt.Println("my app stop")
}

```

#### Advanced example

```go
package main

import (
	"fmt"
	"os"
	"syscall"
	"time"
	
	"github.com/cheggaaa/go-exit"
)

func main() {
	// we can enable http profiling ("net/http/pprof")
{'fraction_non_alphanumeric': 0.1509330406147091, 'fraction_numerical': 0.001646542261251372, 'mean_word_length': 3.5575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3031249', 'n_tokens_mistral': 724, 'n_tokens_neox': 682, 'n_words': 205}