Documentation ¶
Overview ¶
Package validate registers and implements the "validate" apic command.
The validate command analyses the specified API for correctness, reporting errors if any problems are found.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrUnreachable ¶
type ErrUnreachable struct {
analysis.Unreachable
}
ErrUnreachable is the error raised for unreachable code. It wraps an analysis.Unreachable with an error interface.
func (ErrUnreachable) Error ¶
func (e ErrUnreachable) Error() string
type Issues ¶
type Issues []Issue
Issues is a list of issues.
func Inspect ¶
Inspect checks the following: * There are no unreachable blocks. TODO: Check map indices are properly guarded by a check.
func Validate ¶
Validate performs a number of checks on the api file for correctness. If any problems are found then they are returned as errors. If options is nil then full validation is performed.
func WithAnalysis ¶
func WithAnalysis(api *semantic.API, mappings *semantic.Mappings, options *Options, analysis *analysis.Results) Issues
WithAnalysis performs a number of checks on the api file for correctness using pre-built analysis results. If any problems are found then they are returned as errors. If options is nil then full validation is performed.