Version: v0.0.0-...-e560ebb Latest Latest

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0



Package diagnostics provides utilities to collect diagnostics for lint.



This section is empty.


This section is empty.


This section is empty.


type Result

type Result struct {
	Errors errors.MultiError
	// contains filtered or unexported fields

Result contains diagnostic messages from lint.

func (*Result) AppendError

func (r *Result) AppendError(f string, args ...interface{})

AppendError appends an error to result, prefixed with current context.

func (*Result) Display

func (r *Result) Display() []string

Display returns a user-friendly display of diagnostics from a Result.

func (*Result) IsValid

func (r *Result) IsValid() bool

IsValid returns false if the result contains any validation errors, true otherwise.

func (*Result) Merge

func (r *Result) Merge(o Result)

Merge merges another result into the current result.

Diagnostic messages from the incoming Result are prefixed with the current Result's context. Context from the incoming Result is ignored.

func (*Result) PushContext

func (r *Result) PushContext(c string) (popContext func())

PushContext adds context to be prepended to all diagnostic messages.

Contexts can be stacked by calling PushContext() repeatedly. Returns a function to pop the pushed context.

Jump to

Keyboard shortcuts

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