I wrote a function for that a while back but it was a hack. Ubuntu so I used :
fmt.Printf("Hit ANY key to exit: ")
cmd := exec.Command("/bin/stty", "-F", "/dev/tty", "-icanon", "min", "1") // worked ok
after setting raw mode you can :
var keybuf [1]byte
_, _ = os.Stdin.Read(keybuf[0:1])
A problem I had was that on exit the console is still in raw mode, so it needs to be reset with stty every time. It wasn't a
problem for me but your mileage may vary. This was well originally written way before Go1 but assuming you're in a *nix environment you should be able to use something like it.