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 (*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.