Skip to content

fmt.Formatter is not called for %T #73528

Closed as not planned
Closed as not planned
@anacrolix

Description

@anacrolix

Go version

main

Output of go env in your module/workspace:

irrelevant

What did you do?

Pass %T to a format function with an arg that implements fmt.Formatter

fmt.Formatter.Format is not invoked for %T verb. It's also not documented. I believe %p is the same.

What did you see happen?

The type of the arg is printed, rather than performing the action of fmt.Formatter.Format for the type with the T verb.

What did you expect to see?

The result of executing fmt.Formatter.Format for the arg's type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      close