// loop through all features in the shapefile
for shape.Next() {
but in (r *Reader) Next() you return false if the file hits EOF, meaning the last item in the file will not be read.
r.shape.read(er)
if er.e != nil {
r.err = fmt.Errorf("Error while reading next shape: %v", er.e)
return false
}
I know some behaviour changed around EOF as error between go versions a while back (there was very briefly a similar issue in grpc) so I presume this has snuck in that way.
In the example in
README.md
, there is the codebut in
(r *Reader) Next()
you returnfalse
if the file hits EOF, meaning the last item in the file will not be read.I know some behaviour changed around EOF as error between go versions a while back (there was very briefly a similar issue in grpc) so I presume this has snuck in that way.