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

fmt, errors: empty messages in the error chain result in ugly messages #30683

Closed
rogpeppe opened this issue Mar 8, 2019 · 6 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rogpeppe
Copy link
Contributor

rogpeppe commented Mar 8, 2019

$ go version
go version devel +ce7534ff06 Fri Mar 8 13:46:43 2019 +0000 linux/amd64

What did you do?

https://play.golang.org/p/ewauxpVAIji

What did you expect to see?

I would expect to see:

 a: xxxx

What did you see instead?

Instead we see:

a: : xxxx

It's not uncommon to want to wrap errors just to record the location without adding any message (adding an annotation at every level can end up with unwieldy messages), so I think a colon separator should only be printed if there's something to print.

@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 8, 2019
@andybons andybons added this to the Unplanned milestone Mar 8, 2019
@andybons
Copy link
Member

andybons commented Mar 8, 2019

@robpike

@jimmyfrasche
Copy link
Member

@jba @neild

@jba
Copy link
Contributor

jba commented Mar 8, 2019

@mpvl

@robpike robpike changed the title fmt: empty messages in the chain result in ugly messages fmt: empty messages in the error chain result in ugly messages Mar 8, 2019
@bcmills bcmills modified the milestones: Unplanned, Go1.13 Apr 11, 2019
@bcmills bcmills changed the title fmt: empty messages in the error chain result in ugly messages fmt, errors: empty messages in the error chain result in ugly messages Apr 11, 2019
@adg
Copy link
Contributor

adg commented May 31, 2019

Is this bug still current? I don't see an errors.Printer type in the errors package.

@rogpeppe
Copy link
Contributor Author

It seems that the error printing stuff has been removed from errors in tip. I'm not sure what the roadmap is here.

@neild
Copy link
Contributor

neild commented Jun 3, 2019

With the removal of FormatError, this is obsolete.

@neild neild closed this as completed Jun 3, 2019
@golang golang locked and limited conversation to collaborators Jun 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

8 participants