go4.org: go4.org/errorutil Index | Files

package errorutil

import "go4.org/errorutil"

Package errorutil helps make better error messages.

Index

Package Files

highlight.go

func HighlightBytePosition Uses

func HighlightBytePosition(f io.Reader, pos int64) (line, col int, highlight string)

HighlightBytePosition takes a reader and the location in bytes of a parse error (for instance, from json.SyntaxError.Offset) and returns the line, column, and pretty-printed context around the error with an arrow indicating the exact position of the syntax error.

Package errorutil imports 5 packages (graph) and is imported by 16 packages. Updated 2018-12-14. Refresh now. Tools for package owners.