Skip to content

Commit

Permalink
fixed init slice bug
Browse files Browse the repository at this point in the history
  • Loading branch information
devfeel committed Apr 5, 2017
1 parent 17390c1 commit a96dfd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion logger/xlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ func writeFile(logFile string, log string) {
fmt.Println(logFile, err)
return
}
fmt.Print(logstr)
//fmt.Print(logstr)
file.WriteString(logstr)
}
9 changes: 3 additions & 6 deletions render.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ func (r *innerRenderer) parseFile(filename string) (*template.Template, error) {
if !file.Exist(filename) {
tmpFileName := filename
for i := len(r.templatePaths) - 1; i >= 0; i-- {
if r.templatePaths[i] == "" {
break
}
tmpFileName = r.templatePaths[i] + "/" + filename
findlog += "\r\n" + tmpFileName
if file.Exist(tmpFileName) {
Expand Down Expand Up @@ -97,8 +94,8 @@ func NewInnerRenderer() *innerRenderer {
r.templatePaths = make([]string, 3)
//添加基础路径
//base、base/templates、base/views
r.templatePaths = append(r.templatePaths, file.GetCurrentDirectory())
r.templatePaths = append(r.templatePaths, file.GetCurrentDirectory()+"/templates")
r.templatePaths = append(r.templatePaths, file.GetCurrentDirectory()+"/views")
r.templatePaths[0] = file.GetCurrentDirectory()
r.templatePaths[1] = file.GetCurrentDirectory() + "/templates"
r.templatePaths[2] = file.GetCurrentDirectory() + "/views"
return r
}

0 comments on commit a96dfd0

Please sign in to comment.