servovet

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package servovet is the go/analysis analyzer for the two servo mistakes the compiler cannot catch.

The first is a marker call (Build/Root/Bind/Override/Scoped/Include/ Value/Linger/Max) in a file that doesn't carry a build constraint requiring the servoinject tag. Marker bodies panic when actually executed, so such a call would compile into the real binary and panic at runtime instead of being caught here, in the editor, before `go generate` ever runs.

The second is a ScopeKey method with a receiver its body can reach. servo calls that method on a typed nil, and no signature can express "never dereferences the receiver" — so it is checked rather than assumed.

It lives in its own importable package, not in the command, so the integrations the reference promises are actually reachable: golangci-lint's module plugin system imports the analyzer package and registers Analyzer, which nothing can do with a var in package main. cmd/servo-vet is the singlechecker binary wrapping this.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "servovet",
	Doc:  "flags servo marker calls in files missing the servoinject build tag, and ScopeKey methods with a non-blank receiver",
	Run:  run,
}

Analyzer is the servo analyzer, ready to hand to singlechecker, multichecker, unitchecker, golangci-lint's plugin registry, or analysistest.

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