Found a solution. bufio works much faster (since it is buffered, and fmt functions are missing, and it does not parse anything):
reader := bufio.NewReader(os.Stdin) str, _ := reader.ReadString('\n') // Like fmt.Scanf("%s", &str), but faster var x, y rune fmt.Fscanf(reader, "%c %c", &x, &y) // I need to read something else // (see comments for the question) // It easy, as I can use fmt.Fscanf
... even faster than the C scanf() wrapper.
source share