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: document interaction between space and %q #4581

Closed
dsymonds opened this issue Dec 21, 2012 · 2 comments
Closed

fmt: document interaction between space and %q #4581

dsymonds opened this issue Dec 21, 2012 · 2 comments

Comments

@dsymonds
Copy link
Member

@dsymonds dsymonds commented Dec 21, 2012

What would you expect fmt.Sprintf("% 8q", "woo") to return? Right
now it yields `   "woo"`; that is, space padding is applied after quoting. I
would have expected the space padding to be done first, and quoting after, but either
way it is not documented in fmt.
@rsc
Copy link
Contributor

@rsc rsc commented Dec 21, 2012

Comment 1:

Current behavior seems fine (and consistent) to me.
http://play.golang.org/p/KTXnB7Uxkp
Really space is the default for non-numeric padding, so % 8q and %8q are the same.

Labels changed: added priority-later, size-s, suggested, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 22, 2012

Comment 2:

This issue was closed by revision 1cad1f8.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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
3 participants
You can’t perform that action at this time.