From f723940bc7cb8495abebf97a714236b895c7f8c9 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Fri, 15 May 2020 02:23:14 +0200 Subject: [PATCH] Make vet and testing happy --- download/download_test.go | 6 +++--- plugin_test.go | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/download/download_test.go b/download/download_test.go index 467e9f2..edb5ab1 100644 --- a/download/download_test.go +++ b/download/download_test.go @@ -6,20 +6,20 @@ import ( func TestDownloadURL(t *testing.T) { want := "https://github.com/gohugoio/hugo/releases/download/v1.0/hugo_1.0_Linux-64bit.tar.gz" - if got := downloadURL("1.0", false); got != want { + if got := download("1.0", false); got != want { t.Errorf("Download url is not correct, got: %s, want: %s", got, want) } } func TestDownloadURLExtended(t *testing.T) { want := "https://github.com/gohugoio/hugo/releases/download/v0.55.4/hugo_extended_0.55.4_Linux-64bit.tar.gz" - if got := downloadURL("0.55.4", true); got != want { + if got := download("0.55.4", true); got != want { t.Errorf("Download url is not correct, got: %s, want: %s", got, want) } } func TestGet(t *testing.T) { - if binPath , err := Get("0.42", false); err != nil { + if binPath, err := Get("0.42", false); err != nil { t.Errorf("Failed to download archive: %s", err) if binPath == "" { t.Errorf("binPath was nil") diff --git a/plugin_test.go b/plugin_test.go index 0bd22d2..2cf047e 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -1,8 +1,9 @@ package main import ( - "github.com/pkg/errors" "testing" + + "github.com/pkg/errors" ) func TestCommandValidate(t *testing.T) { @@ -25,12 +26,12 @@ func TestCommandValidate(t *testing.T) { func TestVersionEqual(t *testing.T) { want := true - if got := versionsEqual("1.0", "1.0", false); want != got { + if got := versionsEqual("1.0", "1.0"); want != got { t.Errorf("want: %t, got: %t", want, got) } want = false - if got := versionsEqual("1.5", "1.0", false); want != got { + if got := versionsEqual("1.5", "1.0"); want != got { t.Errorf("want: %t, got: %t", want, got) } }