Cleanup model/utils.go (#17945)
* Cleanup model/utils.go - Removed some functions which were unsued. (The unused linter was somehow failing to catch this). - Moved some functions inside other packages. - Removed two duplicate instances of the same function - RemoveDuplicateStrings and UniqueStrings. - Moved some regexes to global vars to prevent compilation every time. ```release-note NONE ``` * fix lint ```release-note NONE ``` * bring back unused exception ```release-note NONE ``` * fix tests ```release-note NONE ``` * Address review comments ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
Claudio Costa
родитель
77f9620997
Коммит
7454680be5
@@ -338,7 +338,7 @@ func TestIsValidAlphaNum(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
actual := IsValidAlphaNum(tc.Input)
|
||||
actual := isValidAlphaNum(tc.Input)
|
||||
require.Equalf(t, actual, tc.Result, "case: %v\tshould returned: %#v", tc, tc.Result)
|
||||
}
|
||||
}
|
||||
@@ -945,7 +945,7 @@ func TestIsValidHttpUrl(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUniqueStrings(t *testing.T) {
|
||||
func TestRemoveDuplicateStrings(t *testing.T) {
|
||||
cases := []struct {
|
||||
Input []string
|
||||
Result []string
|
||||
@@ -973,7 +973,7 @@ func TestUniqueStrings(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
actual := UniqueStrings(tc.Input)
|
||||
actual := RemoveDuplicateStrings(tc.Input)
|
||||
require.Equalf(t, actual, tc.Result, "case: %v\tshould returned: %#v", tc, tc.Result)
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user