url-parser/internal/command/commands.go

20 lines
246 B
Go
Raw Normal View History

2020-09-21 18:24:51 +00:00
package command
2020-02-02 23:05:18 +00:00
import (
"net/url"
"strings"
"github.com/sirupsen/logrus"
)
2020-02-03 11:44:19 +00:00
func parseURL(raw string) *url.URL {
urlString := strings.TrimSpace(raw)
2020-02-02 23:05:18 +00:00
url, err := url.Parse(urlString)
if err != nil {
logrus.Fatal(err)
}
return url
}