From 3c4dd99fbe37970a719b559c8ce0bae4d02d7ab9 Mon Sep 17 00:00:00 2001 From: astaxie Date: Fri, 15 Mar 2013 14:50:56 +0800 Subject: [PATCH] fix window's slash --- template.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/template.go b/template.go index c513567d..73210487 100644 --- a/template.go +++ b/template.go @@ -140,9 +140,10 @@ func (self *templatefile) visit(paths string, f os.FileInfo, err error) error { } } if hasExt { + replace := strings.NewReplacer("\\", "/") a := []byte(paths) a = a[len([]byte(self.root)):] - subdir := path.Dir(strings.TrimLeft(string(a), "/")) + subdir := path.Dir(replace.Replace(strings.TrimLeft(string(a), "/"))) if _, ok := self.files[subdir]; ok { self.files[subdir] = append(self.files[subdir], paths) } else {