You are viewing a single comment's thread. Return to all comments →
You could also just copy from stdin to sdout:
func main() { fmt.Println("Hello, World.") io.Copy(os.Stdout, os.Stdin) }
Or the mentioned solution with bufio.Scanner:
func main() { s := bufio.NewScanner(os.Stdin) fmt.Println("Hello, World.") for s.Scan() { fmt.Println(s.Text()) } }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Hello, World.
You are viewing a single comment's thread. Return to all comments →
You could also just copy from stdin to sdout:
Or the mentioned solution with bufio.Scanner: