Skip to content

text/template: zero template.Template no longer safe for use #11379

@rsc

Description

@rsc

This program worked in Go 1.4 but crashes in Go 1.5.

package main

import "text/template"

func main() {
    template.Must(new(template.Template).New("main").Parse(""))
}

It dies in Parse because the overall group was created with new(template.Template) and has a nil *common pointer. Because this worked in Go 1.4, I think we should keep it working in Go 1.5. That might mean filling in common lazily.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions