fix: remove unnecessary error variable in command URL validation

This commit is contained in:
Chrystian Huot 2026-05-17 08:56:49 -04:00
parent 7d97763f8f
commit 3c4da551c9

View file

@ -95,8 +95,6 @@ func NewCommand(baseDir string) *Command {
}
func (command *Command) Do(action string) {
var err error
i := 1
readVal := func() string {
@ -142,7 +140,7 @@ func (command *Command) Do(action string) {
case COMMAND_ARG_URL:
command.url = readVal()
if err != nil || !regexp.MustCompile(`^https?://`).Match([]byte(command.url)) {
if !regexp.MustCompile(`^https?://`).Match([]byte(command.url)) {
command.exitWithError(errors.New("invalid URL"))
}
}