I’ve been researching file locking options in Go and was reviewing the choices badger has made. In dir_windows.go the following comment appears, “this works but it’s a bit klunky. i’d prefer to use LockFileEx but it needs unsafe pkg”. (link removed because your forum software is bullshit)
I found this a bit surprising because badger does use the unsafe package in other places, and in particular the dir_unix.go relies on the “golang.org/x/sys/unix” package, which also uses unsafe.
Is the comment in dir_windows.go accurate, or is there some other reason to avoid using “golang.org/x/sys/windows” and LockFileEx?