zmap / zannotate

Utility for annotating Internet datasets with contextual metadata (e.g., origin AS, MaxMind GeoIP2, reverse DNS, and WHOIS)
Apache License 2.0
95 stars 17 forks source link

Swap out bufio.Scanner for bufio.Reader #12

Closed bvandersloot closed 6 years ago

bvandersloot commented 6 years ago

Fix #11

zakird commented 6 years ago

I'm not sure if I understand the intuition here behind why Readln was added. Is there any reason to not just use ReadString('\n') or ReadBytes('\n')?

bvandersloot commented 6 years ago

I had not seen ReadString! Not sure how I missed it!

zakird commented 6 years ago

Does this miss the last line? Seems like if err == eof could be weird. Might he worth testing once.

bvandersloot commented 6 years ago

Tested- it catches the last line. The last line is returned with err == nil, then the loop breaks with an EOF error in the normal case.