oschwald / geoip2-golang

Unofficial MaxMind GeoIP2 Reader for Go
ISC License
1.86k stars 191 forks source link

fs.FS support? #79

Closed ainar-g closed 2 years ago

ainar-g commented 2 years ago

Any chance of adding io/fs.FS support to the library (and the underlying libraries, I assume)? That would greatly simplify testing and just generally make the library more versatile.

Thanks.

oschwald commented 2 years ago

I am not sure I fully understand what you are looking for. Internally, this library memory maps the database in most cases, which I don't believe would work with that interface. If a open function was provided that supported that interface, it would have to just read the database into memory and call the FromBytes function. I am not sure it would add anything substantial.

ainar-g commented 2 years ago

Hm, I probably misremembered something, because I thought that FromBytes was a level below this module. It would indeed work in my case. Sorry for the noise.