Help us shape the future of Go! Take the 2026 Go Developer Survey

ownerlock

package
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ownerlock makes one process the owner of a data directory.

Index

Constants

This section is empty.

Variables

View Source
var ErrAnotherOwner = errors.New("another process owns the data directory")

ErrAnotherOwner: another process holds the data directory's lock.

Functions

func Acquire

func Acquire(dataDir string) (release func() error, err error)

Acquire creates dataDir (0700) and takes an exclusive, non-blocking lock on <dataDir>/godwit.lock; it fails with ErrAnotherOwner if someone holds it. On Unix the directory must belong to the current user and is tightened to 0700; on Windows it relies on the user directory's default ACL, and the ACL of a custom data directory is not checked. The lock is released by release or when the process exits, however it exits.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL