Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Wraps Errors with %w Verb #23

Merged
merged 1 commit into from
Sep 15, 2020
Merged

Conversation

danehans
Copy link
Contributor

Wraps errors with %w instead of %v. In Go 1.13, fmt.Errorf() supports a new %w verb. When this verb is present, the error returned by fmt.Errorf() will have an Unwrap method returning the argument of %w, which must be an error. In all other ways, %w is identical to %v.

/assign @jpeach @stevesloka
/cc @Miciah

Signed-off-by: Daneyon Hansen <[email protected]>
@danehans danehans changed the title Wraps Errors with %w Wraps Errors with %w Verb Sep 14, 2020
@Miciah
Copy link

Miciah commented Sep 14, 2020

/lgtm

Copy link
Member

@stevesloka stevesloka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@stevesloka stevesloka merged commit b14d252 into projectcontour:main Sep 15, 2020
@danehans danehans deleted the wrap_errors branch November 2, 2020 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants