errors

command
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

README

gen-errors

This tool generates a CSV file of all parser errors (types which implement parser.ParseError) defined in the parser package, and of all semantic errors (types which implement sema.SemanticError) defined in the sema package.

For each error, the row in the CSV file contains the name of the type, and an example error message. The example error message is generated by calling the Error() method on the error type, after instantiating the error fields with placeholder values.

Usage

To generate the CSV file, run the following command:

go run .

This will write the CSV to the standard output.

Example

name,example
parser.CustomDestructorError,custom destructor definitions are no longer permitted
sema.InvalidDestructionError,cannot destroy value: not a resource

Regenerating errors

To update the code that generates the errors, run the following command:

go generate errors.go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL