Distributed Services with Go: Error during close (page 33)

Hi @travisjeffery, in the Close function on page 33 it seems there is an error, after the i.mmap.Sync is called, the memory is not unmapped, and consequentially the function i.File.Truncate gives an error and can’t close the file.
To solve this, I used i.mmap.UnsafeUnmap() after Sync.
I think there is an issue with the GitHub - tysonmote/gommap: Git mirror of launchpad.net/gommap with additional patches. library, adding the UnsafeUnmap solves the issues for index_test.go but not for segment_test.go it gives me this error:

The requested operation cannot be performed on a file with a user-mapped section open.

Thank you.