Documentation
¶
Index ¶
- Variables
- func AddExtra(diag *hcl.Diagnostic, extra any)
- func AddExtraIfMissing[T any](d Diag, extra T)
- func DiagnosticExtra[T any](diag *hcl.Diagnostic) (_ T, _ bool)
- func DiagnosticsExtra[T any](diags Diag) (val T, found bool)
- func FindByExtra[T any](diags Diag) *hcl.Diagnostic
- func PrintDiags(output io.Writer, diags []*hcl.Diagnostic, fileMap map[string]*hcl.File, ...)
- type Diag
- func (d *Diag) Add(summary, detail string)
- func (d Diag) AddExtra(extra any)
- func (d *Diag) AddWarn(summary, detail string)
- func (d *Diag) Append(diag *hcl.Diagnostic) (addedErrors bool)
- func (d *Diag) AppendErr(err error, summary string) (haveAddedErrors bool)
- func (d *Diag) DefaultSubject(rng *hcl.Range)
- func (d Diag) Error() string
- func (d *Diag) Extend(diags []*hcl.Diagnostic) (haveAddedErrors bool)
- func (d Diag) HasErrors() bool
- type GoJQError
- type PathExtra
- type TracebackExtra
Constants ¶
This section is empty.
Variables ¶
View Source
var RepeatedError = &hcl.Diagnostic{
Severity: hcl.DiagError,
Extra: repeatedError{},
}
Invisible to user error, typically used to signal that the initial block evaluation has failed (and already has reported its errors to user).
Functions ¶
func AddExtra ¶ added in v0.4.2
func AddExtra(diag *hcl.Diagnostic, extra any)
Adds extra without replacing existing extras.
func AddExtraIfMissing ¶ added in v0.4.2
Adds an extra if no extra with the same type is present.
func DiagnosticExtra ¶ added in v0.4.2
func DiagnosticsExtra ¶ added in v0.4.2
func FindByExtra ¶
Types ¶
type Diag ¶
type Diag hcl.Diagnostics // Diagnostics does implement error interface, but not, itself, an error.
func FromErrSubj ¶
func (*Diag) Append ¶
Appends diag to diagnostics, returns true if the just-appended diagnostic is an error.
func (*Diag) DefaultSubject ¶ added in v0.4.2
func (d *Diag) DefaultSubject(rng *hcl.Range)
Set the subject for diagnostics if it's not already specified.
type GoJQError ¶ added in v0.4.2
Attach this as an .Extra on diagnostic to enhance the error message for gojq errors. Diagnostic must include Subject pointing to the query expression.
type PathExtra ¶ added in v0.4.2
func NewPathExtra ¶ added in v0.4.2
type TracebackExtra ¶ added in v0.4.2
type TracebackExtra = *tracebackExtra
func NewTracebackExtra ¶ added in v0.4.2
func NewTracebackExtra() TracebackExtra
Source Files
¶
Click to show internal directories.
Click to hide internal directories.