Documentation
¶
Overview ¶
Package rt contains the runtime code which will support a generated enforcer binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Enforcer ¶
type Enforcer struct { // If true, we will only consider types to implement an interface // if there is an explicit assertion of the form: // var _ Intf = &Impl{} AssertedInterfaces bool // Contracts contains providers for the various Contract types. // This map is the primary point of code-generation. Contracts contract.Providers // Allows the working directory to be overridden. Dir string // The name of the generated linter. Name string // An optional Logger to receive diagnostic messages. Logger *log.Logger // The package-patterns to enforce contracts upon. Packages []string // If true, Main() will call os.Exit(1) if any reports are generated. SetExitStatus bool // If true, the test sources for the package will be included. Tests bool // contains filtered or unexported fields }
Enforcer is the main entrypoint for a generated linter binary. The generated code will just configure an instance of Enforcer and call its Main() method.
type Result ¶
type Result struct { // Nested Results. Children Results // The position of the contract declaration which caused the Result. Contract token.Position // The data written by the Contract. Data bytes.Buffer // The position that the message is associated with. Pos token.Position // The name of the contract which produced the result. Producer string }
A Result describes a message associated with a position in an input file.
func (Result) StringRelative ¶
StringRelative is suitable for human consumption and makes all emitted file paths relative to the given base path.
Click to show internal directories.
Click to hide internal directories.