basicerrors

package
v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorValue = errors.New("this is a typed error")

ErrorValue is a way to make a package level error to check against. I.e. if err == ErrorValue

Functions

func BasicErrors

func BasicErrors()

BasicErrors demonstrates some ways to create errors

func SomeFunc

func SomeFunc() error

SomeFunc returns an error

Types

type CustomError

type CustomError struct {
	Result string
}

CustomError is a struct that will implement the Error() interface

func (CustomError) Error

func (c CustomError) Error() string

type TypedError

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

TypedError is a way to make an error type you can do err.(type) == ErrorValue

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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