nolint

package
v0.75.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package nolint provides shared helpers for nolint-directive detection used by linters within pkg/linters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLineIndex

func BuildLineIndex(pass *analysis.Pass, linterName string) map[string]map[int]struct{}

BuildLineIndex scans all comments in the analysis pass and returns a map from filename → set of line numbers that carry a nolint directive for linterName (e.g. "errstringmatch") or "all".

func HasDirective

func HasDirective(position token.Position, idx map[string]map[int]struct{}) bool

HasDirective reports whether the given source position is covered by a suppression directive for linterName (or "nolint:all"). Both same-line and previous-line directives are recognised, matching golangci-lint behaviour.

func ImplementsError

func ImplementsError(t types.Type) bool

ImplementsError reports whether t implements the built-in error interface.

Types

This section is empty.

Jump to

Keyboard shortcuts

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