Hello adg (cc: golang-dev@googlegroups.com), I'd like you to review this change.
LGTM On Mon, Dec 20, 2010 at 12:29 PM, <r@golang.org> wrote: > Reviewers: adg, > > Message: > Hello adg (cc: golang-dev@googlegroups.com), > > I'd like you to review this change. > > > Description: > template: fix trivial bug: integers are not "empty" > Fixes issue 1357. > > Please review this at http://codereview.appspot.com/3809041/ > > Affected files: > M src/pkg/template/template.go > M src/pkg/template/template_test.go > > > Index: src/pkg/template/template.go > =================================================================== > --- a/src/pkg/template/template.go > +++ b/src/pkg/template/template.go > @@ -673,7 +673,7 @@ > case *reflect.SliceValue: > return v.Len() == 0 > } > - return true > + return false > } > I think a comment here would be appropriate ("values of other types are never empty" - or something along those lines) > > // Look up a variable or method, up through the parent if necessary. > Index: src/pkg/template/template_test.go > =================================================================== > --- a/src/pkg/template/template_test.go > +++ b/src/pkg/template/template_test.go > @@ -197,6 +197,12 @@ > out: " Header\n", > }, > > + &Test{ > + in: "{.section integer}{@}{.end}", > + > + out: "77", > + }, > + > // Repeated > &Test{ > in: "{.section pdata }\n" + > > >
*** Submitted as http://code.google.com/p/go/source/detail?r=f490039d1eb7 *** template: fix trivial bug: integers are not "empty" Fixes issue 1357. R=adg, gri CC=golang-dev http://codereview.appspot.com/3809041