-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed bailing out on empty lines and Add date applet. #8
base: master
Are you sure you want to change the base?
Conversation
We were "return"ing on empty lines, but that's wrong. We want to skip empty lines and carry on with the next line.
Prints the current time.
@@ -59,7 +59,7 @@ func doGrep(pattern *regexp.Regexp, fh io.Reader, fn string, print_fn bool) { | |||
return | |||
} | |||
if line == "" { | |||
break | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although you are right that bailing on empty lines is indeed a bug, this is not the whole fix. Now the only way to exit the for-loop is by encountering an error, which in turn would make grep print an error message when encountering io.EOF
. Could you add a if
for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please wait. Fix pending.
2015-01-15 13:13 GMT+01:00 Alexander Surma notifications@github.com:
In applets/grep/grep.go
#8 (diff):@@ -59,7 +59,7 @@ func doGrep(pattern *regexp.Regexp, fh io.Reader, fn string, print_fn bool) {
return
}
if line == "" {
break
continue
Although you are right that bailing on empty lines is indeed a bug, this
is not the whole fix. Now the only way to exit the for-loop is by
encountering an error, which in turn would make grep print an error message
when encountering io.EOF. Could you add a if for that?—
Reply to this email directly or view it on GitHub
https://github.com/surma/gobox/pull/8/files#r23005769.
I have also added a "date" applet and I am unable to branch off those commits so that they show up in a separate pull request. But the applet is pretty trivial, I think you can review it in 1 minute. |
I already did :D Consider it accepted. |
We were "return"ing on empty lines, but that's wrong. We want to skip empty lines and carry on with the next line.