Skip to content

Commit

Permalink
Bug fix of default template function
Browse files Browse the repository at this point in the history
  • Loading branch information
anarcher committed Aug 12, 2015
1 parent f56b4c0 commit 9b34b2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ func init() {
templateFuncMap = template.FuncMap{
"default": func(args ...string) string {
defer recovery()
return args[0]
if len(args) <= 0 {
return ""
}
return args[len(args)-1]
},
"in": func(arg string, slice []string) bool {
defer recovery()
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package main

const (
VERSION = "0.0.1"
VERSION = "0.0.2"
)

0 comments on commit 9b34b2f

Please sign in to comment.