verification

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package verification provides analyzers for the ok-verify vet tool.

Index

Constants

This section is empty.

Variables

View Source
var CloseCheck = &analysis.Analyzer{
	Name: "closecheck",
	Doc:  "checks that deferred Close() calls check their error return to prevent silent data loss",
	Run:  runCloseCheck,
}
View Source
var ContextBg = &analysis.Analyzer{
	Name: "contextbg",
	Doc:  "checks that context.Background() is not used where a derived context is available",
	Run:  runContextBg,
}
View Source
var DeferInLoop = &analysis.Analyzer{
	Name: "deferinloop",
	Doc:  "checks that defer is not used inside a for loop",
	Run:  runDeferInLoop,
}
View Source
var DoubleClose = &analysis.Analyzer{
	Name: "doubleclose",
	Doc:  "checks for channels that may be closed more than once",
	Run:  runDoubleClose,
}
View Source
var LateCancel = &analysis.Analyzer{
	Name: "latecancel",
	Doc:  "checks that defer cancel() is placed close to context.WithCancel to prevent leaks on early returns",
	Run:  runLateCancel,
}
View Source
var LoopClosure = &analysis.Analyzer{
	Name: "loopclosure",
	Doc:  "checks that goroutines or defer statements inside loops capture loop variables correctly",
	Run:  runLoopClosure,
}
View Source
var MutexCopy = &analysis.Analyzer{
	Name: "mutexcopy",
	Doc:  "checks that sync.Mutex and sync.RWMutex are not copied by value",
	Run:  runMutexCopy,
}
View Source
var NilMapWrite = &analysis.Analyzer{
	Name: "nilmapwrite",
	Doc:  "checks for possible nil map writes that would panic",
	Run:  runNilMapWrite,
}
View Source
var PreallocSlice = &analysis.Analyzer{
	Name: "preallocslice",
	Doc:  "checks that slices with known size are pre-allocated to avoid repeated growth",
	Run:  runPreallocSlice,
}
View Source
var RawAssert = &analysis.Analyzer{
	Name: "rawassert",
	Doc:  "checks that type assertions use the comma-ok pattern to prevent panic on failure",
	Run:  runRawAssert,
}
View Source
var RecoverCheck = &analysis.Analyzer{
	Name: "recovercheck",
	Doc:  "checks that every goroutine has a defer-recover to prevent process crash on panic",
	Run:  runRecoverCheck,
}
View Source
var SleepInLoop = &analysis.Analyzer{
	Name: "sleepinloop",
	Doc:  "checks that time.Sleep inside for loops uses a timer instead for efficiency",
	Run:  runSleepInLoop,
}
View Source
var SprintfHex = &analysis.Analyzer{
	Name: "sprintfhex",
	Doc:  "checks that fmt.Sprintf with %%x is replaced by the faster hex.EncodeToString",
	Run:  runSprintfHex,
}
View Source
var StringCastLoop = &analysis.Analyzer{
	Name: "stringcastloop",
	Doc:  "checks for repeated []byte(string) conversions inside loops that could be hoisted",
	Run:  runStringCastLoop,
}
View Source
var SwitchDefault = &analysis.Analyzer{
	Name: "switchdefault",
	Doc:  "checks that switch statements have a default branch to handle unexpected values",
	Run:  runSwitchDefault,
}
View Source
var TmpDirCheck = &analysis.Analyzer{
	Name: "tmpdircheck",
	Doc:  "checks that os.MkdirTemp is paired with defer os.RemoveAll",
	Run:  runTmpDirCheck,
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package v2 — world-class static analysis platform.
Package v2 — world-class static analysis platform.

Jump to

Keyboard shortcuts

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