Remove HTTP GET params from saving file path

This commit is contained in:
Pijus Kamandulis
2019-06-20 22:49:19 +03:00
parent 63d39f225e
commit 881f1aec48
2 changed files with 9 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package helpers
import (
"log"
"regexp"
"strings"
)
// ToCleanString - replaces spaces with underscores
@@ -13,3 +14,8 @@ func ToCleanString(str string) string {
}
return reg.ReplaceAllString(str, "_")
}
// RemoveGetParams - removes http GET params
func RemoveGetParams(str string) string {
return strings.Split(str, "?")[0]
}