Skip to content

Instantly share code, notes, and snippets.

@gerep
gerep / main.go
Created November 24, 2017 23:10 — forked from hnakamur/main.go
A go example to stop a worker goroutine when Ctrl-C is pressed (MIT License)
package main
import (
"fmt"
"os"
"os/signal"
"time"
"golang.org/x/net/context"
)