console/frontend: better error formatting

This commit is contained in:
Vincent Bernat
2022-05-16 21:41:33 +02:00
parent 7f4a34c17e
commit dd64d02b48
8 changed files with 88 additions and 15 deletions

13
common/helpers/strings.go Normal file
View File

@@ -0,0 +1,13 @@
package helpers
import "unicode"
// Capitalize turns the first letter of a string to its upper case version.
func Capitalize(str string) string {
if len(str) == 0 {
return ""
}
r := []rune(str)
r[0] = unicode.ToUpper(r[0])
return string(r)
}