Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fixed bailing out on empty lines and Add date applet. #8

wants to merge 4 commits into from

Conversation

StefanSchroeder
Copy link

We were "return"ing on empty lines, but that's wrong. We want to skip empty lines and carry on with the next line.

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
Copy link
Owner

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?

Copy link
Author

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.

@StefanSchroeder StefanSchroeder changed the title Fixed bailing out on empty lines. Fixed bailing out on empty lines and Add date applet. Jan 15, 2015
@StefanSchroeder
Copy link
Author

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.

@surma
Copy link
Owner

surma commented Jan 15, 2015

I think you can review it in 1 minute.

I already did :D Consider it accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants