Skip to content

Instantly share code, notes, and snippets.

@cespare
Created September 5, 2013 22:56
Show Gist options
  • Save cespare/6457366 to your computer and use it in GitHub Desktop.
Save cespare/6457366 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
"strconv"
"syscall"
)
func main() {
if len(os.Args) != 2 {
fmt.Println("Usage: ./int PID")
os.Exit(1)
}
pid := os.Args[1]
i, err := strconv.Atoi(pid)
if err != nil {
panic(err)
}
fmt.Println(syscall.Kill(i, syscall.SIGINT))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment