Closed arranlomas closed 2 weeks ago
same here, did you find the problem?
# github.com/edsrzf/mmap-go ../github.com/edsrzf/mmap-go/mmap.go:77:9: undefined: mmap ../github.com/edsrzf/mmap-go/mmap.go:92:10: m.lock undefined (type MMap has no field or method lock, but does have Lock) ../github.com/edsrzf/mmap-go/mmap.go:99:10: m.unlock undefined (type MMap has no field or method unlock, but does have Unlock) ../github.com/edsrzf/mmap-go/mmap.go:104:10: m.flush undefined (type MMap has no field or method flush, but does have Flush) ../github.com/edsrzf/mmap-go/mmap.go:114:10: m.unmap undefined (type *MMap has no field or method unmap, but does have Unmap)
The problem is that there is no mmap system call available in a WebAssembly environment. I think we'd need something like this to make it work: https://github.com/WebAssembly/design/blob/master/FutureFeatures.md#finer-grained-control-over-memory
We could make it so that this package at least compiles in a JS environment, similar to what #25 does on Plan 9. I'm not sure of the appropriate error to return in that case, but I'm open to suggestions or pull requests.
Hi, I made a PR to fix this issue. https://github.com/edsrzf/mmap-go/pull/35
I am trying to build for WebAssembly using go web assembly (more info: https://github.com/golang/go/wiki/WebAssembly)
Running:
GOOS=js GOARCH=wasm go build -o main.wasm
Error: