mirror of
https://github.com/golang/go
synced 2024-11-23 00:20:12 -07:00
bug fix: literals can be empty
R=rsc DELTA=1 (0 added, 0 deleted, 1 changed) OCL=30080 CL=30080
This commit is contained in:
parent
bbc2c03852
commit
9b480bb78a
@ -567,7 +567,7 @@ func (s *State) eval(fexpr expr, value reflect.Value, index int) bool {
|
||||
s.hasOutput = true;
|
||||
// write literal segments
|
||||
for _, lit := range t {
|
||||
if lit[0] == '%' && len(lit) > 1 {
|
||||
if len(lit) > 1 && lit[0] == '%' {
|
||||
// segment contains a %-format at the beginning
|
||||
if lit[1] == '%' {
|
||||
// "%%" is printed as a single "%"
|
||||
|
Loading…
Reference in New Issue
Block a user