repositorypackage
0.0.0-20170914061330-1dbf7103ab7d
Repository: https://github.com/zbiljic/go-filelock.git
Documentation: pkg.go.dev
# README
go-filelock
Linux |
|
Windows |
|
Package go-filelock provides a cross-process mutex based on file locks that works on windows and *nix platforms.
Installation
go get github.com/zbiljic/go-filelock
Example:
import github.com/zbiljic/go-filelock
fl, err := filelock.New(filename)
if err != nil {
panic(err)
}
var lock filelock.TryLockerSafe
lock, err = fl.Lock()
if err != nil {
panic(err)
}
defer lock.Unlock()
...
See the reference for more info.
Copyright © 2017 Nemanja Zbiljić