Skip to content

Instantly share code, notes, and snippets.

@JakeTheCorn
Created July 14, 2018 15:31
Show Gist options
  • Save JakeTheCorn/e2b32ea56127e924ee44e73c6b34cbe1 to your computer and use it in GitHub Desktop.
Save JakeTheCorn/e2b32ea56127e924ee44e73c6b34cbe1 to your computer and use it in GitHub Desktop.
How to read input with the standard library in Go
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