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

Open
rogpeppe opened this Issue Mar 8, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@rogpeppe
Copy link
Contributor

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 this to the Unplanned milestone Mar 8, 2019

@andybons

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

@jimmyfrasche

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

@jba

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2019

@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

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.