Documentation
¶
Overview ¶
Package modelcheck checks that table-backed models are declared only through the generator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Analysis ¶
type Analysis struct {
Package *types.Package
Context context.Context
Info *types.Info
Files *token.FileSet
// contains filtered or unexported fields
}
Analysis retains one package's type information and function-alias definitions.
func (*Analysis) CheckPackage ¶
func (a *Analysis) CheckPackage(syntax []*ast.File) []Diagnostic
CheckPackage checks all syntax files of one package for low-level table declarations.
type Diagnostic ¶
type Diagnostic struct {
Position token.Position `json:"position"`
Target string `json:"target"`
Message string `json:"message"`
}
Diagnostic names the source location, model or type, and the replacement action.
func Check ¶
func Check(ctx context.Context, dir string, patterns []string) (result []Diagnostic, resultErr error)
Check inspects packages below dir matching patterns for low-level table declarations.
func (Diagnostic) String ¶
func (d Diagnostic) String() string