Skip to content

Instantly share code, notes, and snippets.

@angch
Last active June 30, 2017 06:30
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 angch/06539afa52d0f45026b785cff2b40e9b to your computer and use it in GitHub Desktop.
Save angch/06539afa52d0f45026b785cff2b40e9b to your computer and use it in GitHub Desktop.
package main
import (
"bufio"
"fmt"
"io"
"os"
)
func main() {
input := bufio.NewReader(os.Stdin)
for {
line, _, err := input.ReadLine()
if string(line) == "done" || err == io.EOF {
break
}
if err != nil {
panic(err)
}
fmt.Println("Hello,", string(line))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment