diag

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package diag exposes error types used throughout converter and a method to pretty-print them to the screen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagnostic

type Diagnostic struct {
	// Severity holds the severity level of this Diagnostic.
	Severity Severity

	Message string
}

Diagnostic is an individual diagnostic message. Diagnostic messages can have different levels of severities.

func (Diagnostic) Error

func (d Diagnostic) Error() string

Error implements error.

type Diagnostics

type Diagnostics []Diagnostic

Diagnostics is a collection of diagnostic messages.

func (*Diagnostics) Add

func (ds *Diagnostics) Add(severity Severity, message string)

Add adds an individual Diagnostic to the diagnostics list.

type Severity

type Severity int

Severity denotes the severity level of a diagnostic. The zero value of severity is invalid.

const (
	SeverityLevelWarn Severity = iota + 1
	SeverityLevelError
)

Supported severity levels.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳