Commit d3866ddc authored by Rob Pike's avatar Rob Pike

template: fix trivial bug: integers are not "empty"

Fixes #1357.

R=adg, gri
CC=golang-dev
https://golang.org/cl/3809041
parent 8bfa9175
......@@ -673,7 +673,7 @@ func empty(v reflect.Value) bool {
case *reflect.SliceValue:
return v.Len() == 0
}
return true
return false
}
// Look up a variable or method, up through the parent if necessary.
......
......@@ -197,6 +197,12 @@ var tests = []*Test{
out: " Header\n",
},
&Test{
in: "{.section integer}{@}{.end}",
out: "77",
},
// Repeated
&Test{
in: "{.section pdata }\n" +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment