Note: The display of the source code is heavily inspired by the ztrue/tracerr module. Its dependent on running on the machine the code was compiled on. Asserts shouldn't be used in production code anyway.
Add the assert tag to the build command to include the asserts in the code.
If the tag is not present, all assert turn into no-ops.
All asserts are self describing, apart from Always and Never, which are
mean to be used like in the SQLite codebase.
Equals[T comparable](a, b T)NotEquals[T comparable](a, b T)LessThan[T cmp.Ordered](a, b T)MoreThan[T cmp.Ordered](a, b T)LessOrEquals[T cmp.Ordered](a, b T)MoreOrEquals[T cmp.Ordered](a, b T)Nil(v any)NotNil(v any)Always(v bool) boolNever(v bool) bool
The following global variables can be set to change the behavior of the module:
The io.Writer to write the output to. Default is os.Stderr.
The number of source code lines to display around the assert. Default is 5.
The maximum number of stack frames to display. Default is 20.
The return value of the program when an assert fails. Default is 1.
ANSI escape code for the section title. Default is bold underlined.
ANSI escape code for the context lines. Default is light gray.
ANSI escape code for the line with the assert. Default is red.
ANSI escape code for the Argument X part in the Values section.
ANSI escape code for the stack frames. Default is gray.
