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

Skip downloading file by name if it's empty #42

Closed
wants to merge 1 commit into from
Closed

Conversation

bzz
Copy link
Contributor

@bzz bzz commented Mar 27, 2018

Fixes panic from #41 and potentially #33

@bzz
Copy link
Contributor Author

bzz commented Mar 27, 2018

TravisCI failure seems not to be related - it look un-happy with master as well, as it also fails on PR without any code changes i.e #40

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Mar 27, 2018

Closing, as the working tree from go get was not based on the latest master, were this has been already address :/

@bzz bzz closed this Mar 27, 2018
@campoy campoy deleted the fix/empty-filename branch April 4, 2018 18:00
splitFn := func(c rune) bool {
return c == '\n'
}
filenames = strings.FieldsFunc(string(b), splitFn)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be easier to explicitly drop the empty lines inside of downloadFilenames and leave this code as is.

Basically start the for loop with:

for _, filename := range filenames {
   filename = strings.TrimBlank(filename)
   if filename == "" {
      continue
   }
}

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