Help us shape the future of Go! Take the 2026 Go Developer Survey

err

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 137

Documentation

Overview

Package err implements a threadsafe error interface. In my places, I found myself needing a lock to protect writing to a common error interface from multiple go routines (channels are great but slow). This just makes that process more convenient.

Deprecated: use golang.org/x/sync/errgroup or atomic.Pointer[error] instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error deprecated

type Error struct {
	// contains filtered or unexported fields
}

Error is a struct that holds an error and allows this error to be set and retrieved in a threadsafe manner.

Deprecated: use golang.org/x/sync/errgroup or atomic.Pointer[error] instead.

func New deprecated

func New() *Error

New is a constructor to generate a new error object that can be set and retrieved in a threadsafe manner.

Deprecated: use golang.org/x/sync/errgroup or atomic.Pointer[error] instead.

func (*Error) Get deprecated

func (e *Error) Get() error

Get will return any error associated with this structure.

Deprecated: use atomic.Pointer[error]'s Load method instead.

func (*Error) Set deprecated

func (e *Error) Set(err error)

Set will set the error of this structure to the provided value.

Deprecated: use atomic.Pointer[error]'s Store method instead.

Jump to

Keyboard shortcuts

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