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

html/template: t.Tree is always nil #6459

Closed
gopherbot opened this issue Sep 23, 2013 · 5 comments
Closed

html/template: t.Tree is always nil #6459

gopherbot opened this issue Sep 23, 2013 · 5 comments
Milestone

Comments

@gopherbot
Copy link

by yunge.fu:

In pkg/html/template/template.go, the Parse() func do not assign value to t.Tree, which
just be added recently, so it's always nil.

func (t *Template) Parse(src string) (*Template, error) {
        t.nameSpace.mu.Lock()
        t.escaped = false
        t.nameSpace.mu.Unlock()
        ret, err := t.text.Parse(src)
        if err != nil {
                return nil, err
        }
        // In general, all the named templates might have changed underfoot.
        // Regardless, some new ones may have been defined.
        // The template.Template set has been updated; update ours.
        t.nameSpace.mu.Lock()
        defer t.nameSpace.mu.Unlock()
        for _, v := range ret.Templates() {
                name := v.Name()
                tmpl := t.set[name]
                if tmpl == nil {
                        tmpl = t.new(name)
                }
                tmpl.escaped = false
                tmpl.text = v
        }
        return t, nil
}
@rsc
Copy link
Contributor

rsc commented Sep 23, 2013

Comment 1:

Labels changed: added priority-later, go1.3maybe, removed priority-triage.

Status changed to Thinking.

@rsc
Copy link
Contributor

rsc commented Sep 23, 2013

Comment 2:

Rob, please triage.

Labels changed: added go1.2maybe, removed go1.3maybe.

Owner changed to @robpike.

@robpike
Copy link
Contributor

robpike commented Sep 23, 2013

Comment 3:

Labels changed: added priority-soon, go1.2, removed priority-later, go1.2maybe.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Sep 24, 2013

Comment 4:

Status changed to Started.

@robpike
Copy link
Contributor

robpike commented Sep 25, 2013

Comment 5:

This issue was closed by revision e2e9d1d.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@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

3 participants