Skip to content

text/template: Node.String() should reproduce the original template #4593

@moraes

Description

@moraes
I think the text representation of template Nodes should result in the same template
output, when parsed.

Node.String() methods all follow this direction, except TextNode, which outputs the
template text quoted using %q. It should use %s.

This is a really small thing, but I see no reason why Node.String() could not result in
template snippets that reproduce the original. Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions