Glossary: Go Beyond the Basics
wrapping errors (%w)
Also written: %w, fmt.Errorf, wrap
`fmt.Errorf("...: %w", err)` makes a new error that adds context but keeps the original inside, so `errors.Is` and `errors.As` can still find it.
Glossary: Go Beyond the Basics
Also written: %w, fmt.Errorf, wrap
`fmt.Errorf("...: %w", err)` makes a new error that adds context but keeps the original inside, so `errors.Is` and `errors.As` can still find it.