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

check for .shp extension when opening file #32

Closed icholy closed 6 years ago

icholy commented 6 years ago

I was getting a confusing error when trying to open an invalid file.

_, err := shp.Open("foobar")

// 2018/04/23 12:22:36 open fooshp: no such file or directory

This change results in the following error message

// 2018/04/23 12:23:10 Invalid file extension: foobar
codecov-io commented 6 years ago

Codecov Report

Merging #32 into master will decrease coverage by 0.15%. The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
- Coverage   60.25%   60.09%   -0.16%     
==========================================
  Files           6        6              
  Lines         800      802       +2     
==========================================
  Hits          482      482              
- Misses        262      263       +1     
- Partials       56       57       +1
Impacted Files Coverage Δ
reader.go 61.06% <50%> (-0.95%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d108085...93c3b79. Read the comment docs.