From f499c199a1e72bd66f9ec319f8ffa09e452bd24d Mon Sep 17 00:00:00 2001 From: themihai Date: Tue, 7 Jun 2016 19:29:39 +0300 Subject: [PATCH] fix(isEmpty): Ignore empty strings on list iteration. --- mustache.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mustache.go b/mustache.go index 4a0ca2d..041307b 100644 --- a/mustache.go +++ b/mustache.go @@ -472,6 +472,8 @@ func isEmpty(v reflect.Value) bool { return !val.Bool() case reflect.Slice: return val.Len() == 0 + case reflect.String: + return len(strings.TrimSpace(val.String())) == 0 } return false