aboutsummaryrefslogtreecommitdiffstats
path: root/unxhtmlify.go
diff options
context:
space:
mode:
authorTeddy Wing2014-11-13 02:39:35 -0500
committerTeddy Wing2014-11-13 02:39:35 -0500
commita5e49ca0ba59da7ae9ea304c9c44f4ae0f325444 (patch)
tree847a0c8b8bee2dc442a7ca9b45f4e3f8f7ab59f3 /unxhtmlify.go
downloadunXHTMLify-a5e49ca0ba59da7ae9ea304c9c44f4ae0f325444.tar.bz2
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.
Diffstat (limited to 'unxhtmlify.go')
-rw-r--r--unxhtmlify.go17
1 files changed, 17 insertions, 0 deletions
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)
+ }
+}