feat: add upperFirst template function

This commit is contained in:
Thierno IB. BARRY 2020-03-26 01:12:47 +01:00
parent 6050f20bcd
commit 495fa2de57
3 changed files with 51 additions and 6 deletions

View file

@ -332,6 +332,13 @@ func (gen *Generator) render(w io.Writer, unreleased *Unreleased, versions []*Ve
"upper": func(s string) string {
return strings.ToUpper(s)
},
// upper case the first character of a string
"upperFirst": func(s string) string {
if len(s) > 0 {
return strings.ToUpper(string(s[0])) + s[1:]
}
return ""
},
}
fname := filepath.Base(gen.config.Template)