summaryrefslogtreecommitdiffstats
path: root/modules/util/util.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2022-05-10 23:55:54 +0200
committerGitHub <noreply@github.com>2022-05-10 23:55:54 +0200
commit318f360252777c6eb819ab206a1f276fa4969f3a (patch)
tree7a73ede2df5b52be940dd9b4005137c1d5d53c04 /modules/util/util.go
parent3c658dff233e791856496761325f5ebf787d7521 (diff)
downloadgitea-318f360252777c6eb819ab206a1f276fa4969f3a.tar.gz
gitea-318f360252777c6eb819ab206a1f276fa4969f3a.zip
Update go tool dependencies (#19676)
* Update go tool dependencies Updated all tool dependencies to latest tags, hoping CI will like it. * fix new lint errors * handle more strings.Title cases * remove lint skip
Diffstat (limited to 'modules/util/util.go')
-rw-r--r--modules/util/util.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/util/util.go b/modules/util/util.go
index af6581f7cd..351a345473 100644
--- a/modules/util/util.go
+++ b/modules/util/util.go
@@ -11,6 +11,9 @@ import (
"math/big"
"strconv"
"strings"
+
+ "golang.org/x/text/cases"
+ "golang.org/x/text/language"
)
// OptionalBool a boolean that can be "null"
@@ -181,3 +184,10 @@ func ToUpperASCII(s string) string {
}
return string(b)
}
+
+var titleCaser = cases.Title(language.English)
+
+// ToTitleCase returns s with all english words capitalized
+func ToTitleCase(s string) string {
+ return titleCaser.String(s)
+}