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: include concrete type names when using %#v #7082

Closed
gopherbot opened this issue Jan 8, 2014 · 2 comments
Closed

fmt: include concrete type names when using %#v #7082

gopherbot opened this issue Jan 8, 2014 · 2 comments

Comments

@gopherbot
Copy link

by genial@alva.ro:

Formatting using %#v loses the concrete type of any value (at least of basic types) that
is held through an interface type, which makes them impossible to reconstruct, and also
violates the claim of "a Go-syntax representation of the value", because the
result is a different value of a different type.

What steps will reproduce the problem?
http://play.golang.org/p/RebBqTAjS0

What is the expected output?
`main.Bar{Qux:main.Foo(0)}`

What do you see instead?
`main.Bar{Qux:0}`
@griesemer
Copy link
Contributor

Comment 1:

Labels changed: added repo-main.

Owner changed to @robpike.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 2:

I don't believe we should change this at this point. It's never been copy-and-paste-able
into a Go program.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc unassigned robpike Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants