errloc

package module
v0.1.0 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

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

View Source
const RecordSep = "\036" // byte(30) || "\x1e" ... is the ascii Record Separator (RS) character

RecordSep delineates error records

Variables

This section is empty.

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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