Tasks/utils/utils.go

16 lines
262 B
Go

package utils
import "strings"
func GetRedirectUrl(referer string) string {
var redirectUrl string
url := strings.Split(referer, "/")
if len(url) > 4 {
redirectUrl = "/" + strings.Join(url[3:], "/")
} else {
redirectUrl = "/"
}
return redirectUrl
}