errloc

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

README

GoDoc Go Report Card Build Status tag release

errloc

A simple way of creating errors with locations.

The new Unwrap interface is cool and all, but I've always found file:line messages to be helpful in debugging.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RecordSep delineates error records
	RecordSep = "\036" // byte(30) || "\x1e" ... is the ascii Record Separator (RS) character
	// UnitSep is used to make the error more readable
	UnitSep = "\n\t" // "\037" byte(31) || "\x1f" ... is the ascii Unit Separator (US) character
)

lammertbies.nl/comm/info/ascii-characters.html

Functions

func New

func New(e string) error

New creates a new Error of our own liking. The `string` args are assumed to be the error message. The `error`/`Error` arg is assumed to be a Prev. The `Location` arg is assumed to be the Location. The `Kind` arg is the Kind of the error.

Types

type Location

type Location string

Location is the name:line of a file. Ideally returned by Here(). In usage it'll give you the file:line of the invocation of Here() to be passed as part of the error.

func Here

func Here() Location

Here returns the file:line at the point of invocation. This is purely sugar.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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