errors

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WarningsOnly []string

Functions

This section is empty.

Types

type LintRuleError

type LintRuleError struct {
	Text     string
	ID       string
	ObjectID string
	Value    any
	Module   string
}

func NewLintRuleError

func NewLintRuleError(id, objectID, module string, value any, template string, a ...any) *LintRuleError

func (*LintRuleError) EqualsTo

func (l *LintRuleError) EqualsTo(candidate *LintRuleError) bool

type LintRuleErrorsList

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

func (*LintRuleErrorsList) Add

func (l *LintRuleErrorsList) Add(e *LintRuleError)

Add adds new error to the list if it doesn't exist yet. It first checks if error is empty (i.e. all its fields are empty strings) and then checks if error with the same ID, ObjectId and Text already exists in the list.

func (*LintRuleErrorsList) ConvertToError

func (l *LintRuleErrorsList) ConvertToError() error

ConvertToError converts LintRuleErrorsList to a single error. It returns an error that contains all errors from the list with a nice formatting. If the list is empty, it returns nil.

func (*LintRuleErrorsList) Critical

func (l *LintRuleErrorsList) Critical() bool

func (*LintRuleErrorsList) Merge

Merge merges another LintRuleErrorsList into current one, removing all duplicate errors.

Jump to

Keyboard shortcuts

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