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

manualmutexunlock

package
v0.92.6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package manualmutexunlock implements a Go analysis linter that flags mutex Unlock() calls that are not deferred, which can lead to deadlocks if a panic or early return occurs between Lock() and Unlock().

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = resourcetracker.NewAnalyzer(resourcetracker.Config[mutexKey]{
	Name:         "manualmutexunlock",
	Doc:          "reports mutex Unlock() calls that are not deferred",
	Message:      "mutex Unlock() should be deferred immediately after Lock() to prevent deadlocks on panic or early return",
	Acquisitions: mutexLockAcquisitions,
	CleanupKey:   unlockCallKey,
})

Analyzer is the manual-mutex-unlock analysis pass.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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