mirror of
https://github.com/golang/go
synced 2024-11-22 09:24:41 -07:00
template: fix trivial bug: integers are not "empty"
Fixes #1357. R=adg, gri CC=golang-dev https://golang.org/cl/3809041
This commit is contained in:
parent
8bfa9175a3
commit
d3866ddc65
@ -673,7 +673,7 @@ func empty(v reflect.Value) bool {
|
|||||||
case *reflect.SliceValue:
|
case *reflect.SliceValue:
|
||||||
return v.Len() == 0
|
return v.Len() == 0
|
||||||
}
|
}
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look up a variable or method, up through the parent if necessary.
|
// Look up a variable or method, up through the parent if necessary.
|
||||||
|
@ -197,6 +197,12 @@ var tests = []*Test{
|
|||||||
out: " Header\n",
|
out: " Header\n",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
&Test{
|
||||||
|
in: "{.section integer}{@}{.end}",
|
||||||
|
|
||||||
|
out: "77",
|
||||||
|
},
|
||||||
|
|
||||||
// Repeated
|
// Repeated
|
||||||
&Test{
|
&Test{
|
||||||
in: "{.section pdata }\n" +
|
in: "{.section pdata }\n" +
|
||||||
|
Loading…
Reference in New Issue
Block a user