GoLang
xxxxxxxxxx
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
sigs := make(chan os.Signal, 1)
done := make(chan bool, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
go func() {
sig := <-sigs
fmt.Println()
fmt.Println(sig)
done <- true
}()
fmt.Println("awaiting signal")
<-done
fmt.Println("exiting")
}
awaiting signal ^C interrupt exiting
Linux - How to Install anc-api-tools
Linux - How to Install curvedns
Python - Check if a Number is Positive, Negative or 0
Linux - How to Install zenmap
C - Count Number of Digits in an Integer
C++ - Check Leap Year
JavaScript - Check Whether a String Starts and Ends With Certain Characters
C++ - Check Whether a Number is Prime or Not
C - Find Largest Number Using Dynamic Memory Allocation
Kotlin - Round a Number to n Decimal Places
Linux - How to Install xbitmaps
Kotlin - Reverse a Number
Linux - How to Install zstd
Linux - How to Install zfs-test
Kotlin - Find Factorial of a Number
Java - Reverse a Number
Kotlin - Calculate the Sum of Natural Numbers
Linux - How to Install zita-ajbridge
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month