LGTM On Mon, May 19, 2014 at 2:11 PM, <r@golang.org> wrote: > Reviewers: golang-codereviews, > ...
9 years, 11 months ago
(2014-05-19 21:14:00 UTC)
#2
LGTM
On Mon, May 19, 2014 at 2:11 PM, <r@golang.org> wrote:
> Reviewers: golang-codereviews,
>
> Message:
> Hello golang-codereviews@googlegroups.com,
>
> I'd like you to review this change to
> https://code.google.com/p/go
>
>
> Description:
> text/template,html/template: document that partial results may be
> written on error
> Fixes issue 7445.
>
> Please review this at https://codereview.appspot.com/94640043/
>
> Affected files (+12, -0 lines):
> M src/pkg/html/template/template.go
> M src/pkg/text/template/exec.go
>
>
> Index: src/pkg/html/template/template.go
> ===================================================================
> --- a/src/pkg/html/template/template.go
> +++ b/src/pkg/html/template/template.go
> @@ -62,6 +62,9 @@
>
> // Execute applies a parsed template to the specified data object,
> // writing the output to wr.
> +// If an error occurs executing the template or writing its output,
> +// execution stops, but partial results may already have been written to
> +// the output writer.
> // A template may be executed safely in parallel.
> func (t *Template) Execute(wr io.Writer, data interface{}) error {
> if err := t.escape(); err != nil {
> @@ -72,6 +75,9 @@
>
> // ExecuteTemplate applies the template associated with t that has the
> given
> // name to the specified data object and writes the output to wr.
> +// If an error occurs executing the template or writing its output,
> +// execution stops, but partial results may already have been written to
> +// the output writer.
> // A template may be executed safely in parallel.
> func (t *Template) ExecuteTemplate(wr io.Writer, name string, data
> interface{}) error {
> tmpl, err := t.lookupAndEscapeTemplate(name)
> Index: src/pkg/text/template/exec.go
> ===================================================================
> --- a/src/pkg/text/template/exec.go
> +++ b/src/pkg/text/template/exec.go
> @@ -108,6 +108,9 @@
>
> // ExecuteTemplate applies the template associated with t that has the
> given name
> // to the specified data object and writes the output to wr.
> +// If an error occurs executing the template or writing its output,
> +// execution stops, but partial results may already have been written to
> +// the output writer.
> // A template may be executed safely in parallel.
> func (t *Template) ExecuteTemplate(wr io.Writer, name string, data
> interface{}) error {
> tmpl := t.tmpl[name]
> @@ -119,6 +122,9 @@
>
> // Execute applies a parsed template to the specified data object,
> // and writes the output to wr.
> +// If an error occurs executing the template or writing its output,
> +// execution stops, but partial results may already have been written to
> +// the output writer.
> // A template may be executed safely in parallel.
> func (t *Template) Execute(wr io.Writer, data interface{}) (err error) {
> defer errRecover(&err)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-codereviews" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-codereviews+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
*** Submitted as https://code.google.com/p/go/source/detail?r=cd96728bb365 *** text/template,html/template: document that partial results may be written on error ...
9 years, 11 months ago
(2014-05-19 21:29:32 UTC)
#3
Issue 94640043: code review 94640043: text/template,html/template: document that partial resu...
(Closed)
Created 9 years, 11 months ago by r
Modified 9 years, 11 months ago
Reviewers: gobot
Base URL:
Comments: 0