mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
staticcheck: use golang.org/x/text/cases instead of deprecated strings.Title
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0. The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.
This commit is contained in:
@@ -47,6 +47,8 @@ import (
|
||||
"github.com/rclone/rclone/fstest/fstests"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
// Some times used in the tests
|
||||
@@ -270,7 +272,7 @@ func TestHashSums(t *testing.T) {
|
||||
if !hashes.Contains(test.ht) {
|
||||
continue
|
||||
}
|
||||
name := strings.Title(test.ht.String())
|
||||
name := cases.Title(language.Und, cases.NoLower).String(test.ht.String())
|
||||
if test.download {
|
||||
name += "Download"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user