We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b56983d commit e00313fCopy full SHA for e00313f
internal/naming/triming.go
@@ -22,12 +22,10 @@ import (
22
"regexp"
23
)
24
25
-var regexpEndReplace, regexpBeginReplace *regexp.Regexp
26
-
27
-func init() {
28
- regexpEndReplace, _ = regexp.Compile("[^A-Za-z0-9]+$")
29
- regexpBeginReplace, _ = regexp.Compile("^[^A-Za-z0-9]+")
30
-}
+var (
+ regexpEndReplace = regexp.MustCompile("[^A-Za-z0-9]+$")
+ regexpBeginReplace = regexp.MustCompile("^[^A-Za-z0-9]+")
+)
31
32
// Truncate will shorten the length of the instance name so that it contains at most max chars when combined with the fixed part
33
// If the fixed part is already bigger than the max, this function is noop.
0 commit comments