Consider supporting filesystem lock mechanisms
Obviously concurrent changes to the same ini file are now prevented via sync.RWMutex.
This in-memory lock is totally sufficient for most use cases where user needs some safety checks in the same process, but I found myself in situation where I would find an actual file-lock handy.
e.g. to prevent user from opening the file in their editor and start editing the ini file while a go program (using this library) interacts with it.
I think there may be a way to implement this in a way that it doesn't break cross-platform compatibility - just have it gracefully degrade - on systems that don't support flock.
https://golang.org/pkg/syscall/#Flock
Any thoughts - any reasons why a potential PR would not be accepted?
Seems not much resources can be found about Go flock...
- https://github.com/nightlyone/lockfile
- https://gist.github.com/jedy/4167513
Not sure how well they work cross-platform.