vendor: Mega update all dependencies

This commit is contained in:
Jakob Borg
2017-04-05 16:21:57 +02:00
parent 49c1527724
commit 36b8833441
1358 changed files with 55045 additions and 798287 deletions
+11 -6
View File
@@ -2,7 +2,10 @@
package maxminddb
import "os"
import (
"os"
"runtime"
)
// Open takes a string path to a MaxMind DB file and returns a Reader
// structure or an error. The database file is opened using a memory map,
@@ -41,16 +44,18 @@ func Open(file string) (*Reader, error) {
}
reader.hasMappedFile = true
runtime.SetFinalizer(reader, (*Reader).Close)
return reader, err
}
// Close unmaps the database file from virtual memory and returns the
// resources to the system. If called on a Reader opened using FromBytes
// or Open on Google App Engine, this method does nothing.
func (r *Reader) Close() (err error) {
if r.hasMappedFile {
err = munmap(r.buffer)
r.hasMappedFile = false
func (r *Reader) Close() error {
if !r.hasMappedFile {
return nil
}
return err
runtime.SetFinalizer(r, nil)
r.hasMappedFile = false
return munmap(r.buffer)
}