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

Issue 5354045: code review 5354045: text/template: make redefinition of a template in a set... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by r
Modified:
12 years, 6 months ago
Reviewers:
CC:
r2, rsc, golang-dev
Visibility:
Public.

Description

text/template: make redefinition of a template in a set more consistent. Also make it agree with the documentation. You get an error, unless you're calling Add explicitly, in which case it panics since that's almost certainly a bug. The discrepancy was caused by a panic that wasn't turned into an error along one path; deleted the offending function for clarity.

Patch Set 1 #

Total comments: 4

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

Patch Set 3 : diff -r d946ec1f09f6 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -16 lines) Patch
M src/pkg/text/template/parse.go View 2 chunks +5 lines, -12 lines 0 comments Download
M src/pkg/text/template/set.go View 1 2 chunks +5 lines, -4 lines 0 comments Download

Messages

Total messages: 10
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 6 months ago (2011-11-07 23:56:48 UTC) #1
Gus Soden
http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go File src/pkg/text/template/set.go (right): http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go#newcode115 src/pkg/text/template/set.go:115: err = s.add(tmpl) This does not fix the problem. ...
12 years, 6 months ago (2011-11-08 19:58:05 UTC) #2
Gus Soden
http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go File src/pkg/text/template/set.go (right): http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go#newcode115 src/pkg/text/template/set.go:115: err = s.add(tmpl) On 2011/11/08 19:58:05, augustsoden wrote: > ...
12 years, 6 months ago (2011-11-08 20:09:44 UTC) #3
r2
On Nov 8, 2011, at 11:58 AM, augustsoden@rocketmail.com wrote: > > http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go > File src/pkg/text/template/set.go ...
12 years, 6 months ago (2011-11-08 21:21:19 UTC) #4
Gus Soden
> It's needed because it's an error, as documented. The bug was that it was ...
12 years, 6 months ago (2011-11-08 21:59:40 UTC) #5
rsc
http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go File src/pkg/text/template/set.go (right): http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go#newcode104 src/pkg/text/template/set.go:104: // to the set. If a template is redefined, ...
12 years, 6 months ago (2011-11-08 22:10:17 UTC) #6
r
Hello r@google.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 6 months ago (2011-11-08 22:25:06 UTC) #7
r
http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go File src/pkg/text/template/set.go (right): http://codereview.appspot.com/5354045/diff/1/src/pkg/text/template/set.go#newcode104 src/pkg/text/template/set.go:104: // to the set. If a template is redefined, ...
12 years, 6 months ago (2011-11-08 22:26:08 UTC) #8
rsc
LGTM
12 years, 6 months ago (2011-11-08 22:27:15 UTC) #9
r
12 years, 6 months ago (2011-11-08 22:33:11 UTC) #10
*** Submitted as http://code.google.com/p/go/source/detail?r=db6e865e9901 ***

text/template: make redefinition of a template in a set more consistent.
Also make it agree with the documentation. You get an error, unless you're
calling Add explicitly, in which case it panics since that's almost certainly
a bug. The discrepancy was caused by a panic that wasn't turned into
an error along one path; deleted the offending function for clarity.

R=r, rsc
CC=golang-dev
http://codereview.appspot.com/5354045
Sign in to reply to this message.

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