url-parser/commands/commands.go

20 lines
247 B
Go
Raw Normal View History

2020-02-02 23:05:18 +00:00
package commands
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
}