line-filter

This commit is contained in:
Mark McGranaghan 2012-10-09 11:13:13 -07:00
parent cdcf8eaaa5
commit a870b9995d
2 changed files with 4 additions and 3 deletions

View File

@ -35,7 +35,7 @@ func main() {
// The `EOF` error is expected when we reach the // The `EOF` error is expected when we reach the
// end of input, so exit gracefully in that case. // end of input, so exit gracefully in that case.
// Otherwise there is a problem. // Otherwise there's a problem.
if err == io.EOF { if err == io.EOF {
return return
} }

View File

@ -1,8 +1,9 @@
# Make a file with a few lowercase lines. # To try out our line filter, first make a file with a few
# lowercase lines.
$ echo 'hello' > /tmp/lines $ echo 'hello' > /tmp/lines
$ echo 'filter' >> /tmp/lines $ echo 'filter' >> /tmp/lines
# Use the line filter to get uppercase lines. # Then use the line filter to get uppercase lines.
$ cat /tmp/lines | go run line-filters.go $ cat /tmp/lines | go run line-filters.go
HELLO HELLO
FILTER FILTER