url-parser/internal/command/commands.go
2020-09-21 20:24:51 +02:00

20 lines
246 B
Go

package command
import (
"net/url"
"strings"
"github.com/sirupsen/logrus"
)
func parseURL(raw string) *url.URL {
urlString := strings.TrimSpace(raw)
url, err := url.Parse(urlString)
if err != nil {
logrus.Fatal(err)
}
return url
}