Add singularize template func

See #1438
This commit is contained in:
Bjørn Erik Pedersen
2015-09-22 22:31:02 +02:00
parent 751d4906ef
commit 8d695ec592
3 changed files with 13 additions and 1 deletions

View File

@@ -1379,6 +1379,13 @@ func init() {
}
return inflect.Pluralize(word), nil
},
"singularize": func(in interface{}) (string, error) {
word, err := cast.ToStringE(in)
if err != nil {
return "", err
}
return inflect.Singularize(word), nil
},
}
}