When working with standard input (usually it's terminal) we often stumble-upon the scenario where we read which includes the new line as well. In happy world, Input ends when user press Enter but not always. In Golang world, by tweaking input reader logic, we can easily achieve that and that's the topic for today to snippet around.
--
❯ go run 36-reading-multiline-user-input.goEnter Multiline Input: this is line1> this is line2> line3>Input is: [this is line1 this is line2 line3]No of lines in input: 3
Facebook Page Facebook Group Twitter Feed Telegram Group
No comments:
Post a Comment