@@ -152,7 +152,21 @@ func Process1(t Template, wr io.Writer, fileNameTempl string, fileName string) e
152
152
return Execute (t , wr , fileNameT , m )
153
153
}
154
154
155
- // Execute will execute the Template on the given data map `m`.
155
+ // Execute0 will execute the Template given as strTempl with the given data map `m` (i.e., no template file and no data file).
156
+ // It parses text template strTempl then applies it to to the specified data
157
+ // object m, and writes the output to wr. If an error occurs executing the
158
+ // template or writing its output, execution stops, but partial results may
159
+ // already have been written to the output writer. A template may be
160
+ // executed safely in parallel, although if parallel executions share a
161
+ // Writer the output may be interleaved.
162
+ func Execute0 (t Template , wr io.Writer , strTempl string , m EgData ) error {
163
+ verbose ("Execute with template string: " + strTempl , 1 )
164
+ tmpl , err := t .Parse (strTempl )
165
+ checkError (err )
166
+ return tmpl .Execute (wr , m )
167
+ }
168
+
169
+ // Execute will execute the Template from fileNameT on the given data map `m`.
156
170
func Execute (t Template , wr io.Writer , fileNameT string , m EgData ) error {
157
171
// 1. Check locally
158
172
verbose ("Checking for template locally: " + fileNameT , 1 )
0 commit comments