6 "golang.org/x/text/cases"
7 "golang.org/x/text/language"
10func Capitalize(text string) string {
11 return cases.Title(language.English, cases.Compact).String(text)
14// NormalizeSpace normalizes whitespace in the given content string.
15// It replaces Windows-style line endings with Unix-style line endings,
16// converts tabs to four spaces, and trims leading and trailing whitespace.
17func NormalizeSpace(content string) string {
18 content = strings.ReplaceAll(content, "\r\n", "\n")
19 content = strings.ReplaceAll(content, "\t", " ")
20 content = strings.TrimSpace(content)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list