File: mmap_stub.go

package info (click to toggle)
golang-github-oschwald-maxminddb-golang-v2 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,132 kB
  • sloc: perl: 557; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//go:build appengine || plan9 || js || wasip1 || wasi

package maxminddb

import (
	"errors"
)

type mmapUnsupportedError struct{}

func (mmapUnsupportedError) Error() string {
	return "mmap is not supported on this platform"
}

func (mmapUnsupportedError) Is(target error) bool {
	return target == errors.ErrUnsupported
}

func mmap(_, _ int) (data []byte, err error) {
	return nil, mmapUnsupportedError{}
}

func munmap(_ []byte) (err error) {
	return mmapUnsupportedError{}
}