]> Sergey Matveev's repositories - path-extractor.git/blobdiff - validators.go
Check if path ends with '.', if yes, invalid path
[path-extractor.git] / validators.go
index bef5f6551fb36c07987424ab8006169af4d58d01..2ed2a880065e7d97e9f5d6e64b3c724edeeb71f4 100644 (file)
@@ -56,6 +56,16 @@ func isVersion(input string) bool {
        return r.Match([]byte(input))
 }
 
+func endsWithInvalidString(input string) bool {
+       invalidEndings := []string{"."}
+       for _, s := range invalidEndings {
+               if strings.LastIndex(input, s) == len(input)-len(s) {
+                       return true
+               }
+       }
+       return false
+}
+
 func containsInvalidString(input string) bool {
        invalidStrings := []string{"(", ")", "and/or", "origin/", "{", "}", "<", ">", "$", "*"}
        for _, s := range invalidStrings {