I am trying to implement this behaviour in my golang CLI based program. The behaviour is simple, I just want to print something to console while user is typing something.
This is the code I have written.
// %a code that reads the user input in a different thread%
fmt.Print("\r[*] this is a message.") // erases the current line then prints the message
fmt.Print("\n\r") // creates new empty line
fmt.Print(">>> " + %CURRENT_STDIN_LINE_BUFFER%) // prints the prompt ">>>" then writes the user input
The only missing thing is equilavent of readline.get_line_buffer() python function in golang.