1
- //go:build !appengine && !plan9
2
- // +build !appengine,!plan9
1
+ //go:build !appengine && !plan9 && !js && !wasip1
2
+ // +build !appengine,!plan9,!js,!wasip1
3
3
4
4
package maxminddb
5
5
@@ -9,10 +9,10 @@ import (
9
9
)
10
10
11
11
// Open takes a string path to a MaxMind DB file and returns a Reader
12
- // structure or an error. The database file is opened using a memory map,
13
- // except on Google App Engine where mmap is not supported; there the database
14
- // is loaded into memory. Use the Close method on the Reader object to return
15
- // the resources to the system.
12
+ // structure or an error. The database file is opened using a memory map
13
+ // on supported platforms. On platforms without memory map support, such
14
+ // as WebAssembly or Google App Engine, the database is loaded into memory.
15
+ // Use the Close method on the Reader object to return the resources to the system.
16
16
func Open (file string ) (* Reader , error ) {
17
17
mapFile , err := os .Open (file )
18
18
if err != nil {
@@ -51,9 +51,7 @@ func Open(file string) (*Reader, error) {
51
51
return reader , nil
52
52
}
53
53
54
- // Close unmaps the database file from virtual memory and returns the
55
- // resources to the system. If called on a Reader opened using FromBytes
56
- // or Open on Google App Engine, this method does nothing.
54
+ // Close returns the resources used by the database to the system.
57
55
func (r * Reader ) Close () error {
58
56
var err error
59
57
if r .hasMappedFile {
0 commit comments