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
Assignees
Milestone

Comments

@0xmohit
Copy link
Contributor

@0xmohit 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

@quentinmit quentinmit commented Oct 3, 2016

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 this to the Go1.8 milestone Oct 3, 2016
@robpike
Copy link
Contributor

@robpike robpike commented Oct 4, 2016

We just need to document it.

@robpike robpike added Documentation and removed NeedsDecision labels Oct 4, 2016
@quentinmit quentinmit added the NeedsFix label Oct 7, 2016
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 16, 2016

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

@gopherbot gopherbot closed this in ac1108b Oct 18, 2016
@golang golang locked and limited conversation to collaborators Oct 18, 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
4 participants
You can’t perform that action at this time.