url-parser/commands/commands.go
2020-02-03 00:05:18 +01:00

21 lines
291 B
Go

package commands
import (
"net/url"
"strings"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
)
func parseURL(c *cli.Context) *url.URL {
urlString := strings.TrimSpace(c.String("url"))
url, err := url.Parse(urlString)
if err != nil {
logrus.Fatal(err)
}
return url
}