Parse creates a new shell format template and parses the template definition from string s.
(s string)
| 27 | // Parse creates a new shell format template and parses the template |
| 28 | // definition from string s. |
| 29 | func Parse(s string) (t *Template, err error) { |
| 30 | t = new(Template) |
| 31 | t.tree, err = parse.Parse(s) |
| 32 | if err != nil { |
| 33 | return nil, err |
| 34 | } |
| 35 | return t, nil |
| 36 | } |
| 37 | |
| 38 | // ParseFile creates a new shell format template and parses the template |
| 39 | // definition from the named file. |