jonas-p / go-shp

Go library for reading and writing ESRI Shapefiles. Pure Golang implementation based on the ESRI Shapefile technical description.
MIT License
255 stars 67 forks source link

Use type switch in WriteAttribute #19

Closed tdilo closed 6 years ago

tdilo commented 6 years ago

Add tests for WriteAttribute and simplify the code somewhat - a regular type switch gets the work done.

tdilo commented 6 years ago

All done.

The intent never was to properly mock out the standard seek return values, as the return value is not used. As I understand the returned offset is always relative to the beginning of the file, which would get tricky with the various seek modes and missing information about header size.