Created
August 29, 2019 05:21
-
-
Save sahajre/27779c60ff1bff753fd755c5bb794d22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"strings" | |
) | |
const input = `Hello | |
, 世界 | |
` | |
func main() { | |
s := bufio.NewScanner(strings.NewReader(input)) | |
for s.Scan() { | |
fmt.Print(s.Text()) | |
} | |
fmt.Println() | |
if err := s.Err(); err != nil { | |
log.Fatal(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment