Complete move map code to page code in render module
This commit is contained in:
@@ -113,12 +113,11 @@ func (en *Engine) Exec(input []byte, ctx context.Context) (bool, error) {
|
||||
// - the template for the given node point is note available for retrieval using the resource.Resource implementer.
|
||||
// - the supplied writer fails to process the writes.
|
||||
func(en *Engine) WriteResult(w io.Writer) error {
|
||||
location, idx := en.st.Where()
|
||||
//location, idx := en.st.Where()
|
||||
r, err := en.vm.Render()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c, err := io.WriteString(w, r)
|
||||
log.Printf("%v bytes written as result for %v idx %v", c, location, idx)
|
||||
_, err = io.WriteString(w, r)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -36,9 +36,11 @@ func Loop(en *Engine, startSym string, ctx context.Context, reader io.Reader, wr
|
||||
if err != nil {
|
||||
return fmt.Errorf("unexpected termination: %v\n", err)
|
||||
}
|
||||
b := bytes.NewBuffer(nil)
|
||||
en.WriteResult(b)
|
||||
writer.Write(b.Bytes())
|
||||
//b := bytes.NewBuffer(nil)
|
||||
err = en.WriteResult(writer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
writer.Write([]byte{0x0a})
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user