Daemonizing Go Programs (with a BSD-style rc.d example)
Posted on by Andrew Gallant: BurntSushi
Go, by its very nature, is multithreaded. This makes a traditional approach of daemonizing Go programs by forking a bit difficult.
To get around this, you could try something as simple as backgrounding your Go program and instructing it to ignore the HUP signal: