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: docs specify incorrect format for uint when printed with %#v #17322

Closed
0xmohit opened this issue Oct 3, 2016 · 3 comments
Closed

fmt: docs specify incorrect format for uint when printed with %#v #17322

0xmohit opened this issue Oct 3, 2016 · 3 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@0xmohit
Copy link
Contributor

0xmohit commented Oct 3, 2016

What version of Go are you using (go version)?

go version go1.7.1 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build963251590=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

What did you do?

https://play.golang.org/p/vDgR-zpii2

What did you expect to see?

As per the documentation:

The default format for %v is:
uint, uint8 etc.: %d, %x if printed with %#v

What did you see instead?

unsigned integers when printed with %#v are formatted similar to %#x.

Here is a test supporting it.

@robpike robpike self-assigned this Oct 3, 2016
@quentinmit
Copy link
Contributor

Can we really do anything with this at this point? I think we have to keep the current behavior to preserve backwards compatibility.

@quentinmit quentinmit added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Oct 3, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Oct 3, 2016
@robpike
Copy link
Contributor

robpike commented Oct 4, 2016

We just need to document it.

@robpike robpike added Documentation and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Oct 4, 2016
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 7, 2016
@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Oct 18, 2017
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants