Clone this repo:


  1. 5d0bd0f Merge pull request #6 from riannucci/patch-3 by Daniel Jacques · 8 months ago master
  2. bb8aaff Rename aix to lock_posix.go by Robert Iannucci · 8 months ago
  3. e51aef0 Merge pull request #5 from riannucci/patch-2 by Daniel Jacques · 8 months ago
  4. 1e7daf7 Add support for aix by Robert Iannucci · 8 months ago
  5. 93e3b0d Merge pull request #4 from vadimsht/keep-alive by Daniel Jacques · 9 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