Documentation ¶
Overview ¶
Package errutil implements some error utility functions.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UseColor = true
UseColor indicates if error messages should use colors.
Functions ¶
func Err ¶
Err returns an error which contains position information from the callee. The original position information is left unaltered if available.
func New ¶
New returns an error which contains position information from the callee.
Example ¶
package main import ( "fmt" "github.com/mewkiz/pkg/errutil" ) func main() { errutil.UseColor = false err := errutil.New("failure.") fmt.Println(err) }
Output: github.com/mewkiz/pkg/errutil_test.ExampleNew (err_test.go:11): failure.
func NewNoPos ¶
NewNoPos returns an error which explicitly contains no position information. Further calls to Err will not embed any position information.
Types ¶
Click to show internal directories.
Click to hide internal directories.