# flock (Go)

> Thread-safe file locking for Go

Source: https://talira.ai/catalog/flock-go-9tvcpnav
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / concurrency](https://talira.ai/categories/libraries/concurrency), [libraries / filesystem](https://talira.ai/categories/libraries/filesystem), [languages / go](https://talira.ai/categories/languages/go)
- Licence: BSD-3-Clause[^1][^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [The Go Commune](https://talira.ai/orgs/gofrs.md)

flock is a Go package that implements a thread-safe file lock, with a non-blocking `TryLock()` so code can try to take the lock without waiting. It was first `theckman/go-flock`, which its author moved to the Gofrs organization.

## Links

- GitHub: https://github.com/gofrs/flock
- Docs: https://pkg.go.dev/github.com/gofrs/flock

## Problems it solves

- stop two copies of my Go program running the same job at once
- take a lock file without blocking if another process holds it
- coordinate access to a shared file between Go processes

## Features

- thread-safe file lock
- non-blocking TryLock
- Unlock to release

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.64, adoption 0.58, momentum 0.25, community 0.55, backing 0.30, extensibility 0.00.

- last commit 22 days ago
- 6 commits in the last 90 days
- latest release v0.13.2 22 days ago
- 772 GitHub stars
- 23 contributors
- backed by The Go Commune

## Sources

[^1]: https://github.com/gofrs/flock/blob/main/README.md (checked 29 Nov 2026)
[^2]: https://github.com/gofrs/flock/blob/main/LICENSE (checked 29 Nov 2026)
