Skip to content

devilsray/golang-errorinterface-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Go Example for the error interface / how to handle and identify error types

This little example has two error types which support the error interface. 100 errors are generated randomly, the error type will pe checked and printed out.

To run this example in linux use following:

go get github.com/devilsray/golang-errorinterface-example
cd $GOPATH/src/github.com/devilsray/golang-errorinterface-example/
go run *.go

The output will look like

0: this is an error from type TypeAError

1: and this is an error from type TypeBError

2: this is an error from type TypeAError

3: this is an error from type TypeAError

.....

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages