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: %d format allows function argument #7097

Closed
rogpeppe opened this issue Jan 10, 2014 · 4 comments
Closed

fmt: %d format allows function argument #7097

rogpeppe opened this issue Jan 10, 2014 · 4 comments
Assignees

Comments

@rogpeppe
Copy link
Contributor

@rogpeppe rogpeppe commented Jan 10, 2014

package main
import "fmt"
func f() {}
func main() {
    fmt.Printf("%d\n", f)
}

This prints "4197376", not "%!d(func()=0x400c00)" as I would expect.
@robpike
Copy link
Contributor

@robpike robpike commented Jan 10, 2014

Comment 2:

Owner changed to @robpike.

Status changed to Accepted.

@remyoudompheng
Copy link
Contributor

@remyoudompheng remyoudompheng commented Jan 10, 2014

Comment 3:

How does this relate to issue #3936 and revision 365d02e0927c ?
@robpike
Copy link
Contributor

@robpike robpike commented Jan 13, 2014

Comment 4:

Working as intended, or at least as a consequence of the desire to provide non-hex
formats to pointers.

Status changed to WorkingAsIntended.

@rogpeppe
Copy link
Contributor Author

@rogpeppe rogpeppe commented Jan 13, 2014

Comment 5:

I didn't realise we wanted to do that. Why do we have a %p verb?
@golang golang locked and limited conversation to collaborators Jun 25, 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
4 participants
You can’t perform that action at this time.