mirror of
https://github.com/git-chglog/git-chglog.git
synced 2026-01-23 02:15:12 +00:00
feat: add upperFirst template function
This commit is contained in:
parent
6050f20bcd
commit
495fa2de57
3 changed files with 51 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue