I don't believe there's currently a library function to do it, but
it's certainly possible to implement as all the relevant syscalls are
available within a Go program.
You could try finding a C implementation of 'daemon' for your system
and implementing it in Go: