Suppress staticcheck linter warnings

Fix a couple of warnings like this one:

> pkg/formats/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)

This is caused by the fact that Go 1.18 strings package made a
(somewhat strange) decision to deprecate strings.Title. The suggestion
to replace it with a new package is a bit too much.

Silence the warning instead, as we are pretty sure this function works
for us.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2022-04-09 15:22:22 -07:00
parent bbe3459db0
commit 1c0a796d9a
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ var basicFunctions = template.FuncMap{
},
"split": strings.Split,
"join": strings.Join,
"title": strings.Title,
"title": strings.Title, //nolint:staticcheck
"lower": strings.ToLower,
"upper": strings.ToUpper,
"pad": padWithSpace,

View File

@ -47,7 +47,7 @@ var DefaultFuncs = FuncMap{
"lower": strings.ToLower,
"pad": padWithSpace,
"split": strings.Split,
"title": strings.Title,
"title": strings.Title, //nolint:staticcheck
"truncate": truncateWithLength,
"upper": strings.ToUpper,
}