Documentation
¶
Index ¶
Constants ¶
const ( FixEndpointHeaderFromMessage = "endpoint_header_from_message" FixInsertMissingUse = "insert_missing_use" )
Variables ¶
var Registry = []Code{}/* 105 elements not displayed */
Registry is the current inventory of diagnostic codes emitted by the parser, compiler, build generator, contract scanner, and language tooling.
Functions ¶
func Suggestions ¶
Suggestions returns close diagnostic-code matches for an unknown code.
Types ¶
type Code ¶
type Code struct {
Code string
Area string
Stability Stability
Severity Severity
Fix *Fix
Summary string
}
Code describes one public diagnostic code emitted by GOWDK tooling.
type Explanation ¶
type Explanation struct {
Code string `json:"code"`
Area string `json:"area"`
Stability Stability `json:"stability"`
Severity Severity `json:"severity"`
Fix *Fix `json:"fix,omitempty"`
Summary string `json:"summary"`
Details string `json:"details,omitempty"`
NextSteps []string `json:"nextSteps,omitempty"`
Invalid string `json:"invalid,omitempty"`
Fixed string `json:"fixed,omitempty"`
}
Explanation is the user-facing diagnostic explanation payload.
func Explain ¶
func Explain(code string) (Explanation, bool)
Explain returns a user-facing explanation for code.
type Fix ¶ added in v0.3.0
type Fix struct {
Title string `json:"title"`
Description string `json:"description"`
Rewriter string `json:"rewriter,omitempty"`
}
Fix describes one machine-readable rewrite available for a diagnostic code.
type Severity ¶ added in v0.3.0
type Severity string
Severity describes the default impact of a diagnostic code. Individual emitters may still upgrade or downgrade a diagnostic when runtime context makes that more precise.
func DefaultSeverity ¶ added in v0.3.0
DefaultSeverity returns the registry severity for code.