From 4f822500f20dd75740e1f63b7e6ef69a14ca9144 Mon Sep 17 00:00:00 2001 From: appleboy Date: Fri, 4 Oct 2024 15:22:05 +0800 Subject: [PATCH] style: refactor codebase for improved consistency and clarity - Reorder imports in `jenkins_test.go` and `plugin_test.go` to move `assert` import to the end - Remove unnecessary empty line in `plugin.go` Signed-off-by: appleboy --- jenkins_test.go | 4 ++-- plugin.go | 1 - plugin_test.go | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/jenkins_test.go b/jenkins_test.go index c84858d..05031df 100644 --- a/jenkins_test.go +++ b/jenkins_test.go @@ -1,10 +1,10 @@ package main import ( - "github.com/stretchr/testify/assert" - "net/url" "testing" + + "github.com/stretchr/testify/assert" ) func TestParseJobPath(t *testing.T) { diff --git a/plugin.go b/plugin.go index d25e1b8..b1bc905 100644 --- a/plugin.go +++ b/plugin.go @@ -31,7 +31,6 @@ func trimElement(keys []string) []string { // Exec executes the plugin. func (p Plugin) Exec() error { - if len(p.BaseURL) == 0 || len(p.Username) == 0 || len(p.Token) == 0 { return errors.New("missing jenkins config") } diff --git a/plugin_test.go b/plugin_test.go index 6b67199..e26fc2b 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -1,9 +1,9 @@ package main import ( - "github.com/stretchr/testify/assert" - "testing" + + "github.com/stretchr/testify/assert" ) func TestMissingConfig(t *testing.T) {