Skip to content

Instantly share code, notes, and snippets.

View nathanblair's full-sized avatar
:octocat:
Livin' the dream!

Nathan Blair nathanblair

:octocat:
Livin' the dream!
View GitHub Profile
@nathanblair
nathanblair / main_loop.go
Last active February 21, 2022 03:02
Create an interruptible, scheduled event loop in go
import (
"log"
"os"
"os/signal"
"syscall"
"time"
)
// registers a channel for handling an program kill/interrupt signal
func RegisterInterruptHandler() (interrupt chan os.Signal) {