Created
July 14, 2018 15:31
-
-
Save JakeTheCorn/e2b32ea56127e924ee44e73c6b34cbe1 to your computer and use it in GitHub Desktop.
How to read input with the standard library in Go
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
func main() { | |
input := readInput() | |
fmt.Print(input) | |
} | |
func readInput() string { | |
input := "" | |
fmt.Scanln(&input) | |
return input | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment