scanner := bufio.NewScanner(os.Stdin) if scanner.Scan() { line := scanner.Text() fmt.Printf("Input was: %q\n", line) }