From 2a098955fbbe67d706d3131404e584f177d21f53 Mon Sep 17 00:00:00 2001 From: Max Chechel Date: Sun, 4 Mar 2018 00:07:29 +0300 Subject: [PATCH] fixed bad target test --- options.go | 2 +- options_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/options.go b/options.go index 10213f4..354b58a 100644 --- a/options.go +++ b/options.go @@ -48,7 +48,7 @@ func GetOptions(arguments []string, stdout, stderr io.Writer, exit exitFunc) Opt errors = append(errors, fmt.Sprintf("failed to parse target URL: %v", err)) } - if targetURL.Scheme != "http" && targetURL.Scheme != "https" { + if targetURL != nil && targetURL.Scheme != "http" && targetURL.Scheme != "https" { errors = append(errors, fmt.Sprintf("unsupported scheme: %q", targetURL.Scheme)) } diff --git a/options_test.go b/options_test.go index feed745..3d36a04 100644 --- a/options_test.go +++ b/options_test.go @@ -54,7 +54,7 @@ func TestGetOptions(t *testing.T) { name: "bad target", args: func(t *testing.T) args { return args{ - arguments: []string{"-t", "!"}, + arguments: []string{"-t", "::"}, stderr: ioutil.Discard, exit: func(code int) { if code != 2 {