Skip to content

Glossary: Go Basics

errors.New and fmt.Errorf

Also written: errors.New, fmt.Errorf, Errorf

Ways to make your own errors: `errors.New` makes one with a fixed message, and `fmt.Errorf` builds one with `Printf` verbs and can wrap another error with `%w`.

Where the book teaches it