finding

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package finding defines the Finding type produced by mem-guard heuristics along with severity levels and human/JSON printers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintJSON

func PrintJSON(w io.Writer, findings []Finding) error

PrintJSON writes findings as a JSON array.

func PrintText

func PrintText(w io.Writer, findings []Finding) error

PrintText writes findings as human-readable text.

func Sort

func Sort(findings []Finding)

Sort orders findings by severity (error first), then file, then line.

Types

type Finding

type Finding struct {
	Heuristic string         `json:"heuristic"`
	Severity  Severity       `json:"severity"`
	Position  token.Position `json:"position"`
	Message   string         `json:"message"`
	LoopKind  string         `json:"loop_kind,omitempty"`
	FuncName  string         `json:"func_name"`
	Details   string         `json:"details,omitempty"`
}

Finding represents a single analysis result.

func (Finding) String

func (f Finding) String() string

type Severity

type Severity int

Severity indicates confidence that a finding is a real issue.

const (
	SeverityInfo    Severity = iota // pattern detected, may be intentional
	SeverityWarning                 // likely an issue but uncertain
	SeverityError                   // high confidence unbounded growth
)

func (Severity) MarshalJSON

func (s Severity) MarshalJSON() ([]byte, error)

func (Severity) String

func (s Severity) String() string

Jump to

Keyboard shortcuts

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