From 43048009fb39b3fd44c3f84c888346b0bdbdd0ee Mon Sep 17 00:00:00 2001 From: Hitesh Jasani Date: Wed, 13 Nov 2013 15:12:45 -0500 Subject: [PATCH] Add more informative error message when partial is not found. --- mustache.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mustache.go b/mustache.go index a5cbd29..aa7153c 100644 --- a/mustache.go +++ b/mustache.go @@ -140,7 +140,8 @@ func (tmpl *Template) parsePartial(name string) (*Template, error) { } } if filename == "" { - return nil, errors.New(fmt.Sprintf("Could not find partial %q", name)) + return nil, errors.New(fmt.Sprintf("Could not find partial %q in %q", + name, filenames)) } partial, err := ParseFile(filename) @@ -390,7 +391,7 @@ Outer: } } if name == "." { - return v + return v } switch av := v; av.Kind() { case reflect.Ptr: