Registry / utility / theckman-go-flock

theckman-go-flock

JSON →
library0.13.0gogounverified

Package flock implements a thread-safe interface for file locking.

go get github.com/theckman/go-flock
INSTALL
IMPORT
SIG · THECKMAN-GO-FLOCK
T
theckman-go-flock
utilitygov0.13.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

flock
github.com/theckman/go-flock

Try to acquire a file lock and release it.

package main import ( "fmt" "github.com/theckman/go-flock" ) func main() { lock := flock.NewFlock("/tmp/lockfile") locked, err := lock.TryLock() if err != nil { fmt.Println(err) return } if locked { fmt.Println("Lock acquired") lock.Unlock() } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.13.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
theckman-go-flock — go get theckman-go-flock · libregistry