Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(247)

Issue 5437147: code review 5437147: html/template: simplify ExecuteTemplate a little (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by r
Modified:
13 years, 4 months ago
Reviewers:
r2, rog
CC:
MikeSamuel, golang-dev
Visibility:
Public.

Description

html/template: simplify ExecuteTemplate a little Allow the text template to handle the error case of no template with the given name. Simplification suggested by Mike Samuel.

Patch Set 1 #

Patch Set 2 : diff -r 77404a124c34 https://go.googlecode.com/hg/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -8 lines) Patch
M src/pkg/html/template/template.go View 2 chunks +7 lines, -8 lines 1 comment Download

Messages

Total messages: 6
r
Hello mikesamuel@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 4 months ago (2011-12-06 19:05:48 UTC) #1
MikeSamuel
+1
13 years, 4 months ago (2011-12-06 20:34:31 UTC) #2
MikeSamuel
Rietveld doesn't like +1. LGTM
13 years, 4 months ago (2011-12-06 20:34:49 UTC) #3
r
*** Submitted as http://code.google.com/p/go/source/detail?r=8eb71b50b26f *** html/template: simplify ExecuteTemplate a little Allow the text template to ...
13 years, 4 months ago (2011-12-06 20:47:22 UTC) #4
rog
http://codereview.appspot.com/5437147/diff/5001/src/pkg/html/template/template.go File src/pkg/html/template/template.go (right): http://codereview.appspot.com/5437147/diff/5001/src/pkg/html/template/template.go#newcode56 src/pkg/html/template/template.go:56: panic("html/template internal error: template escaping out of sync") i ...
13 years, 4 months ago (2011-12-07 09:02:58 UTC) #5
r2
13 years, 4 months ago (2011-12-07 19:14:56 UTC) #6
On Dec 7, 2011, at 1:02 AM, rogpeppe@gmail.com wrote:

> 
>
http://codereview.appspot.com/5437147/diff/5001/src/pkg/html/template/templat...
> File src/pkg/html/template/template.go (right):
> 
>
http://codereview.appspot.com/5437147/diff/5001/src/pkg/html/template/templat...
> src/pkg/html/template/template.go:56: panic("html/template internal
> error: template escaping out of sync")
> i wonder if it might be worth still unlocking the mutex here - someone
> might catch the panic.

sure, although it is an internal error and things really are borked and
execution should stop. this is one case where panic makes sense: the guarantee
the package makes cannot be satisfied.

-rob


Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b