I can't point you to an example because that wouldn't be idiomatic Go; thus such examples are (I hope) hard to find. In Go you shouldn't busy wait using a function like "
kbhit" . You should create a channel for communicating the keys that are seen, create a goroutine that reads from os.Stdin and injects keys into that channel, then use an event loop in a different goroutine that uses "
select" to read key events from that channel.