in

A tiny library for handling system interrupts


Tiny library for manage you application shutdown in graceful way by catching the OS signals.

Documentation

Installation

go get -u github.com/heartwilltell/waitabit

Usage

package main

import (
    "log"
    "os"

    "github.com/heartwilltell/waitabit"
)


func main() { 
	
    // call your application here ...
    
    wait := waitabit.NewWait(os.Interrupt)
    wait.WaitWithFunc(func() {
        log.Println("Bye")
    })
    
    // or ...
    
    waitabit.NewWait(os.Interrupt).WaitWithFunc(func() {
    	log.Println("Bye")
    })
    
}

GitHub

https://github.com/heartwilltell/waitabit




Chat Easy — Send WhatsApp messages without saving the contact number

Samsung Galaxy Tab A8 Launched at a Budget Offer, Check Specifications