From bf29b40a8c915187fd11378c56cd93bc2177219b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 27 Mar 2022 22:15:42 +0200 Subject: [PATCH] staticcheck: ignore SA1019: strings.Title is deprecated This function is deprecated because it has known limitations when using with multi-byte strings. This limitations are quite "corner case", and our use (mostly) is for ASCII strings. The suggestion replacement brings 20k+ lines of code, which is a bit too much to fix those corner cases. templates/templates.go:23:14: SA1019: strings.Title is deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck) "title": strings.Title, ^ Signed-off-by: Sebastiaan van Stijn --- templates/templates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/templates.go b/templates/templates.go index 0e8dd15368..deb043299d 100644 --- a/templates/templates.go +++ b/templates/templates.go @@ -20,7 +20,7 @@ var basicFunctions = template.FuncMap{ }, "split": strings.Split, "join": strings.Join, - "title": strings.Title, + "title": strings.Title, //nolint:staticcheck // strings.Title is deprecated, but we only use it for ASCII, so replacing with golang.org/x/text is out of scope "lower": strings.ToLower, "upper": strings.ToUpper, "pad": padWithSpace,