MCPcopy Index your code
hub / github.com/gofrs/flock

github.com/gofrs/flock @v0.13.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.13.0 ↗ · + Follow
76 symbols 300 edges 8 files 35 documented · 46% 205 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

flock

Go Reference License Go Report Card

flock implements a thread-safe file lock.

It also includes a non-blocking TryLock() function to allow locking without blocking execution.

Installation

go get -u github.com/gofrs/flock

Usage

import "github.com/gofrs/flock"

fileLock := flock.New("/var/lock/go-lock.lock")

locked, err := fileLock.TryLock()

if err != nil {
    // handle locking error
}

if locked {
    // do work
    fileLock.Unlock()
}

For more detailed usage information take a look at the package API docs on GoDoc.

License

flock is released under the BSD 3-Clause License. See the LICENSE file for more details.

Project History

This project was originally github.com/theckman/go-flock, it was transferred to Gofrs by the original author Tim Heckman .

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 57
Function 13
Struct 3
TypeAlias 2
FuncType 1

Languages

Go100%

Modules by API surface

flock.go19 symbols
flock_test.go18 symbols
flock_unix_fcntl.go14 symbols
flock_unix.go8 symbols
flock_windows.go7 symbols
flock_others.go5 symbols
flock_example_test.go3 symbols
flock_internal_test.go2 symbols

For agents

$ claude mcp add flock \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page