Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

vimagination.zapto.org/errors

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vimagination.zapto.org/errors

Go Modules
Version
v1.0.0
Version published
Created
Source

errors

CI Go Reference Go Report Card

-- import "vimagination.zapto.org/errors"

Package errors is a simple package with a few error related types.

Highlights

  • Allows for const string error values.
  • Add stack traces to errors.
  • Add context messages to errors.

Usage

package main

import (
	"fmt"

	"vimagination.zapto.org/errors"
)

func main() {
	const ErrExample errors.Error = "my example error"

	err := errors.AddTrace(errors.WithContext("An error: ", ErrExample))

	fmt.Println(err)

	trace := err.(*errors.Trace)

	fmt.Println(trace.Traces[0].Function)

	// Output:
	// An error: my example error
	// main.main
}

Documentation

Full API docs can be found at:

https://pkg.go.dev/vimagination.zapto.org/errors

FAQs

Package last updated on 27 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts