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: no padding applied for value 0 when precision is set to 0 #14924

Closed
martisch opened this issue Mar 23, 2016 · 1 comment
Closed

fmt: no padding applied for value 0 when precision is set to 0 #14924

martisch opened this issue Mar 23, 2016 · 1 comment

Comments

@martisch
Copy link
Contributor

@martisch martisch commented Mar 23, 2016

at least go1.6 and go tip

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

fmt.Printf("|%6v|\n",1)
fmt.Printf("|%6.v|\n",1)
fmt.Printf("|%6v|\n",0)
fmt.Printf("|%6.v|\n",0)

output is:

|     1|
|     1|
|     0|
||

Last line should contain 6 spaces:

|      |

Padding should also apply to 0 like it does for any other integer when precision is set to zero.

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 23, 2016

CL https://golang.org/cl/20920 mentions this issue.

@gopherbot gopherbot closed this in aec8e14 Mar 30, 2016
@golang golang locked and limited conversation to collaborators Mar 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.