Skip to content

Instantly share code, notes, and snippets.

@jmewes
Created February 7, 2022 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmewes/cae973900b4f52b440eef58fc0bf316b to your computer and use it in GitHub Desktop.
Save jmewes/cae973900b4f52b440eef58fc0bf316b to your computer and use it in GitHub Desktop.
Read a one-word string from STDIN
module experimental-software.com/sandbox
go 1.17
package main
import (
"fmt"
)
func main() {
// var reader = bufio.NewReader(os.Stdin)
// message, _ := reader.ReadString(' ')
// fmt.Println(message)
var input string
fmt.Scan(&input)
fmt.Println(input)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment