Skip to content

Commit 3d24201

Browse files
authored
strings: Made strings Title thread safe (#207)
Made strings Title thread safe
1 parent 0479721 commit 3d24201

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

strings/strings.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import (
1414
"golang.org/x/text/language"
1515
)
1616

17-
var c = cases.Title(language.English)
18-
1917
// SubstringSearchOptions contains options for substring search.
2018
type SubstringSearchOptions struct {
2119
CaseInsensitive bool // Perform case-insensitive search
@@ -95,6 +93,8 @@ func SubstringSearch(input, substring string, options SubstringSearchOptions) []
9593

9694
// Title return string in title case with English language-specific title
9795
func Title(input string) string {
96+
c := cases.Title(language.English)
97+
9898
return c.String(input)
9999
}
100100

0 commit comments

Comments
 (0)