spiegel/internal/utils/utils.go

21 lines
262 B
Go
Raw Normal View History

2024-05-22 02:59:08 +02:00
package utils
import (
"regexp"
2024-05-22 03:07:33 +02:00
"github.com/sirupsen/logrus"
2024-05-22 02:59:08 +02:00
)
2024-05-22 03:07:33 +02:00
func IsHTTPRepo(url string) bool {
2024-05-22 02:59:08 +02:00
regex := "^http.?://.*"
2024-05-22 03:07:33 +02:00
result, err := regexp.MatchString(regex, url)
2024-05-22 02:59:08 +02:00
if err != nil {
logrus.Fatal(err)
}
if result {
return true
}
return false
}