3 ms·
For people doing memory mapping in Go, I would strongly advise calling debug.SetPanicOnFault() and setting up a panic handler. Without it, your program will sim
by EdSchouten 6y ago
For people doing memory mapping in Go, I would strongly advise calling debug.SetPanicOnFault() and setting up a panic handler. Without it, your program will simply crash in case of I/O failures, file truncation, etc..
Here's some code I wrote some time ago that does exactly this:
https://github.com/buildbarn/bb-storage/blob/c346ca331930f1bc5e4f9bde75de96ee3e6c8a9c/pkg/blockdevice/memory_mapped_block_device_unix.go#L46-L55 https://github.com/buildbarn/bb-storage/blob/c346ca331930f1b...