From a5e49ca0ba59da7ae9ea304c9c44f4ae0f325444 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 13 Nov 2014 02:39:35 -0500 Subject: Initial commit. Copy stdin to stdout. Copy the code from here: http://golang.org/pkg/bufio/#example_Scanner_lines to read stdin line by line and print it back to stdout. --- unxhtmlify.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 unxhtmlify.go diff --git a/unxhtmlify.go b/unxhtmlify.go new file mode 100644 index 0000000..cf1ed90 --- /dev/null +++ b/unxhtmlify.go @@ -0,0 +1,17 @@ +package main + +import ( + "bufio" + "fmt" + "os" +) + +func main() { + scanner := bufio.NewScanner(os.Stdin) + for scanner.Scan() { + fmt.Println(scanner.Text()) + } + if err := scanner.Err(); err != nil { + fmt.Fprintf(os.Stderr, "reading standard input", err) + } +} -- cgit v1.2.3