Clone this repo:


  1. eebdc48 Merge pull request #12 from danjacques/dependabot/go_modules/ by Daniel Jacques · 3 months ago master
  2. 2283808 Bump from 0.0.0-20211216021012-1d35b9e2eb4e to 0.1.0 by dependabot[bot] · 3 months ago
  3. 6e321f4 Merge pull request #11 from fancl20/master by Daniel Jacques · 1 year, 4 months ago
  4. b7bdc06 Use legacy syscall package for AIX by Chenlin Fan · 1 year, 4 months ago
  5. cc7f001 Merge pull request #10 from fancl20/master by Daniel Jacques · 1 year, 5 months ago


Go implementation of filesystem-level locking.

GoDoc Build Status Coverage Status

gofslock offers several features:

  • Exclusive and shared locking senamtics.
  • Consistent intra- and inter-processing locking behavior across major operating systems (notably Linux, Mac, and Windows).
  • Works on all Go versions.
  • Only depends on Go standard library.
  • Locking behavior and interaction is heavily tested.


Request features and report bugs using the GitHub Issue Tracker.


Contributions to this project are welcome, though please file an issue before starting work on anything major.

To get started contributing to this project, clone the repository:

git clone

This repository uses pre-commit-go to validate itself. Please install this prior to working on the project:

  • Make sure your and are configured in git config.
  • Install test-only packages: go get -u -t
  • Install the pcg git hook: go get -u && pcg