input.go 324 B

12345678910111213141516171819
  1. package cmdline
  2. import (
  3. "bufio"
  4. "fmt"
  5. "os"
  6. "strings"
  7. )
  8. func EnterToContinue() {
  9. fmt.Print("Press 'Enter' to continue...")
  10. bufio.NewReader(os.Stdin).ReadBytes('\n')
  11. }
  12. func ReadLine(prompt string) string {
  13. fmt.Print(prompt)
  14. input, _ := bufio.NewReader(os.Stdin).ReadString('\n')
  15. return strings.TrimSpace(input)
  16. }