FATHOM5CORP/ais

Add a Scanner to RecordSet

zacsketches opened this issue · 0 comments

Client's of package ais are expected to properly employ the idiom of calling Read() and then testing for io.EOF or passing the error along to another check for error != nil. A Scanner as implmented in bufio would alleviate this boilerplate and then clients could just make calls to Scan() and have this low level io.EOF handling taken care of. This would reduce client code to iterate over a recordset to

for scanner.Scan(){
    rec := scanner.Record()
} 
if err := scanner.Error(); err != nil {
    // Deal with scanner errors.
}