Created
July 27, 2021 14:31
-
-
Save wneessen/e5aafa8b1871d954bd6e05aafbb815ae to your computer and use it in GitHub Desktop.
Read input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"log" | |
"os" | |
) | |
func main() { | |
stdinReader := bufio.NewReader(os.Stdin) | |
e, err := stdinReader.ReadString('\n') | |
if err != nil { | |
log.Println("Error:", err) | |
} | |
log.Println("You entered:", e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment