gofrs/flock
Thread-safe file locking library in Go
📋 What's Changed
- Minimum Go version 1.24
- feat: add Stat method by @ferhatelmas in https://github.com/gofrs/flock/pull/127
- chore(deps): bump golang.org/x/sys from 0.22.0 to 0.37.0
- Full Changelog: https://github.com/gofrs/flock/compare/v0.12.1...v0.13.0
📋 What's Changed
- tests: add tests about directory support by @ldez in https://github.com/gofrs/flock/pull/89
- chore(deps): bump golang.org/x/sys from 0.21.0 to 0.22.0 in the all group by @dependabot in https://github.com/gofrs/flock/pull/90
- fix: missing read-write flag in reopenFDOnError by @crazy-max in https://github.com/gofrs/flock/pull/95
✨ New Contributors
- @crazy-max made their first contribution in https://github.com/gofrs/flock/pull/95
- Full Changelog: https://github.com/gofrs/flock/compare/v0.12.0...v0.12.1
📋 What's Changed
- feat: differentiation of Solaris and Illumos by @ldez in https://github.com/gofrs/flock/pull/80
- feat(windows): replace custom implementation with golang.org/x/sys/windows by @ldez in https://github.com/gofrs/flock/pull/81
- fix: update fnctl implementation by @ldez in https://github.com/gofrs/flock/pull/84
- feat: use runtime errors instead of compilation errors for unsupported platforms by @ldez in https://github.com/gofrs/flock/pull/85
- refactor: use x/sys/* instead of Syscall when possible by @ldez in https://github.com/gofrs/flock/pull/87
- Full Changelog: https://github.com/gofrs/flock/compare/v0.11.0...v0.12.0
📋 What's Changed
- feat: add options to define flag and permissions of the file by @ldez in https://github.com/gofrs/flock/pull/76
- tests: remove files generated during tests by @ldez in https://github.com/gofrs/flock/pull/77
- Full Changelog: https://github.com/gofrs/flock/compare/v0.10.0...v0.11.0
📋 What's Changed
- feat: add support for Illumos/Solaris by @gaige in https://github.com/gofrs/flock/pull/63
- chore: migrate from gopkg.in/check to stretchr/testify by @ldez in https://github.com/gofrs/flock/pull/70
- docs: remove reference to sync.Locker by @ldez in https://github.com/gofrs/flock/pull/66
✨ New Contributors
- @gaige made their first contribution in https://github.com/gofrs/flock/pull/63
- Full Changelog: https://github.com/gofrs/flock/compare/v0.9.0...v0.10.0
📋 What's Changed
- chore: add go modules by @moskyb in https://github.com/gofrs/flock/pull/57
- chore(deps): bump golang.org/x/sys from 0.20.0 to 0.21.0 by @dependabot in https://github.com/gofrs/flock/pull/65
- fix: replace Syscall6 with SyscallN on Windows by @ldez
✨ New Contributors
- @moskyb made their first contribution in https://github.com/gofrs/flock/pull/57
- @ldez made their first contribution in https://github.com/gofrs/flock/pull/64
- Full Changelog: https://github.com/gofrs/flock/compare/v0.8.1...v0.9.0
📋 Changes
- Fix issue caused by calling F_SETLKW instead of F_SETLK (#52 [[@jwatson-cgu](https://github.com/jwatson-cgu)])
📋 Changes
- Add AIX platform support (#40 / @Helflym)
📋 Changes
- Fix issues in the license file, update year.
📋 Changes
- Ensure we release file handle if we failed to take an exclusive lock (#43 / @azr, #31 / @virtuald)
📋 Changes
- Fix linting issues and add goreportcard badge (#34 / @tariq1890)
📋 Changes
- add `New()` function to package for creating a flock file.
- deprecate `NewFlock()` in favor of `New()`
📋 Changes
- Add method to satisfy `io.Closer` interface. Thanks to
This change includes a behavior improvement which should result in this working across NFS mounts. This is done transparently, and should not require that consumers change how they use the package. The methodology decided on by understanding how the `flock` utility handles this on Linux. This improvement was contributed by Dustin Spicuzza (@virtuald) in #22.
📋 Changes
- support for shared locks (RLock) was added by @theory (https://github.com/theckman/go-flock/pull/15) targeting both UNIX and Windows operating systems
📋 Changes
- Fix behavior of TryLock() so that it doesn't return an error when the file is
Add `TryLockContext` method to try and take an exclusive lock, while providing a retry mechanism with a retry frequency (duration) and a context. This allows you to retry taking the lock every `n` milliseconds, and to use the context to time out after a period `t` seconds if no lock could be obtained. This version introduces a dependency on Go 1.7+.
This is `v0.1.0` of `go-flock`. This is the same functionality that has existed for awhile, but this creates an explicit tag for it.
