diagnostic

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package diagnostic hosts the diagnostic engine, which is responsible for collecting the conflicts from annotation-based checks (no-infer mode) and/or inference (full-infer mode) and generating user-friendly diagnostics from those conflicts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine is the main engine for generating diagnostics from conflicts.

func NewEngine

func NewEngine(pass *analysis.Pass) *Engine

NewEngine creates a new diagnostic engine.

func (*Engine) AddOverconstraintConflict

func (e *Engine) AddOverconstraintConflict(nilReason, nonnilReason inference.ExplainedBool)

AddOverconstraintConflict adds a new overconstraint conflict to the engine.

func (*Engine) AddSingleAssertionConflict

func (e *Engine) AddSingleAssertionConflict(trigger annotation.FullTrigger)

AddSingleAssertionConflict adds a new single assertion conflict to the engine.

func (*Engine) Diagnostics

func (e *Engine) Diagnostics(grouping bool) []analysis.Diagnostic

Diagnostics generates diagnostics from the internally-stored conflicts. The grouping parameter controls whether the conflicts with the same nil flow -- the part in the complete nil flow going from a nilable source point to the conflict point -- are grouped together (under the first diagnostic) for concise reporting. The returned slice of diagnostics are sorted by file names and then offsets in the file.

Jump to

Keyboard shortcuts

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