Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: the Go 1.13 release notes don't mention the new “%w” verb in fmt #32914

Open
ainar-g opened this issue Jul 3, 2019 · 4 comments

Comments

Projects
None yet
6 participants
@ainar-g
Copy link
Contributor

commented Jul 3, 2019

A user on Reddit has noticed that the Go 1.13 release notes don't seem to mention the %w verb for fmt.Errorf.

@bcmills bcmills added this to the Go1.13 milestone Jul 3, 2019

@bcmills bcmills added the NeedsFix label Jul 3, 2019

@bcmills

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

@neild, @mpvl, @jba: any suggested phrasing for the release note?

@jba

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2019

Under fmt:

The Errorf function has a new verb, %w, whose operand must be an error. The error returned from Errorf will wrap the operand of %w, so that calling Unwrap will return it.

@neild

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

How about:

The Errorf function has a new verb, %w, whose operand must be an error. The error returned from Errorf will have an Unwrap method which returns the operand of %w.

(You can "wrap" an error without having an Unwrap method.)

@rasky

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

As a beginner in this new error handling structure, I find jba’s phrasing much clearer.

Neild’s phrasing is confusing because people not exposed to these new APIs will not immediately understand the implications of “having a Unwrap method”. On the other hand, in jba’s phrasing, saying that the new error will “wrap” the previous one is much clearer, and the following sentence even explains what’s the goal of the Unwrap method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.