From 31867a926176d4b85592d0f14edb3a5574c87a67 Mon Sep 17 00:00:00 2001 From: Eoin McAfee Date: Tue, 1 Jun 2021 10:29:58 +0100 Subject: [PATCH] group imports --- core/template.go | 1 + handler/api/template/all.go | 3 ++- handler/api/template/all_test.go | 7 ++++--- handler/api/template/create.go | 3 ++- handler/api/template/delete.go | 3 ++- handler/api/template/delete_test.go | 7 ++++--- handler/api/template/find.go | 3 ++- handler/api/template/find_test.go | 7 ++++--- handler/api/template/list.go | 3 ++- handler/api/template/list_test.go | 7 ++++--- handler/api/template/update.go | 3 ++- handler/api/template/update_test.go | 7 ++++--- plugin/converter/starlark.go | 3 ++- plugin/converter/starlark/starlark.go | 1 + plugin/converter/template_test.go | 5 +++-- service/hook/parser/parse.go | 2 +- store/template/template.go | 1 + store/template/template_test.go | 3 ++- 18 files changed, 43 insertions(+), 26 deletions(-) diff --git a/core/template.go b/core/template.go index 7d406bd2b..29fccc87d 100644 --- a/core/template.go +++ b/core/template.go @@ -16,6 +16,7 @@ package core import ( "context" + "github.com/drone/drone/handler/api/errors" ) diff --git a/handler/api/template/all.go b/handler/api/template/all.go index 370fadc43..837d67d34 100644 --- a/handler/api/template/all.go +++ b/handler/api/template/all.go @@ -7,9 +7,10 @@ package template import ( + "net/http" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/render" - "net/http" ) // HandleListAll returns an http.HandlerFunc that writes a json-encoded diff --git a/handler/api/template/all_test.go b/handler/api/template/all_test.go index 33ceea533..e6022ee41 100644 --- a/handler/api/template/all_test.go +++ b/handler/api/template/all_test.go @@ -9,15 +9,16 @@ package template import ( "context" "encoding/json" + "net/http" + "net/http/httptest" + "testing" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/errors" "github.com/drone/drone/mock" "github.com/go-chi/chi" "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" - "net/http" - "net/http/httptest" - "testing" ) var ( diff --git a/handler/api/template/create.go b/handler/api/template/create.go index e4294f212..431476b52 100644 --- a/handler/api/template/create.go +++ b/handler/api/template/create.go @@ -8,9 +8,10 @@ package template import ( "encoding/json" + "net/http" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/render" - "net/http" ) type templateInput struct { diff --git a/handler/api/template/delete.go b/handler/api/template/delete.go index 66ae16ca0..a69b9ec73 100644 --- a/handler/api/template/delete.go +++ b/handler/api/template/delete.go @@ -7,10 +7,11 @@ package template import ( + "net/http" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/render" "github.com/go-chi/chi" - "net/http" ) // HandleDelete returns an http.HandlerFunc that processes http diff --git a/handler/api/template/delete_test.go b/handler/api/template/delete_test.go index 9fb9cd01f..93e63c297 100644 --- a/handler/api/template/delete_test.go +++ b/handler/api/template/delete_test.go @@ -9,14 +9,15 @@ package template import ( "context" "encoding/json" + "net/http" + "net/http/httptest" + "testing" + "github.com/drone/drone/handler/api/errors" "github.com/drone/drone/mock" "github.com/go-chi/chi" "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" - "net/http" - "net/http/httptest" - "testing" ) func TestHandleDelete(t *testing.T) { diff --git a/handler/api/template/find.go b/handler/api/template/find.go index 6b4bc853a..1cb249053 100644 --- a/handler/api/template/find.go +++ b/handler/api/template/find.go @@ -7,10 +7,11 @@ package template import ( + "net/http" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/render" "github.com/go-chi/chi" - "net/http" ) // HandleFind returns an http.HandlerFunc that writes json-encoded diff --git a/handler/api/template/find_test.go b/handler/api/template/find_test.go index 9db1a5eb1..a8ef64549 100644 --- a/handler/api/template/find_test.go +++ b/handler/api/template/find_test.go @@ -9,14 +9,15 @@ package template import ( "context" "encoding/json" + "net/http" + "net/http/httptest" + "testing" + "github.com/drone/drone/handler/api/errors" "github.com/drone/drone/mock" "github.com/go-chi/chi" "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" - "net/http" - "net/http/httptest" - "testing" ) func TestHandleFind(t *testing.T) { diff --git a/handler/api/template/list.go b/handler/api/template/list.go index a600b4357..c73150eb5 100644 --- a/handler/api/template/list.go +++ b/handler/api/template/list.go @@ -7,10 +7,11 @@ package template import ( + "net/http" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/render" "github.com/go-chi/chi" - "net/http" ) // HandleList returns an http.HandlerFunc that writes a json-encoded diff --git a/handler/api/template/list_test.go b/handler/api/template/list_test.go index 6ddae1461..dba3e13eb 100644 --- a/handler/api/template/list_test.go +++ b/handler/api/template/list_test.go @@ -7,14 +7,15 @@ package template import ( "context" "encoding/json" + "net/http" + "net/http/httptest" + "testing" + "github.com/drone/drone/handler/api/errors" "github.com/drone/drone/mock" "github.com/go-chi/chi" "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" - "net/http" - "net/http/httptest" - "testing" ) func TestHandleList(t *testing.T) { diff --git a/handler/api/template/update.go b/handler/api/template/update.go index 0f58b6691..8a8f35101 100644 --- a/handler/api/template/update.go +++ b/handler/api/template/update.go @@ -6,10 +6,11 @@ package template import ( "encoding/json" + "net/http" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/render" "github.com/go-chi/chi" - "net/http" ) type templateUpdate struct { diff --git a/handler/api/template/update_test.go b/handler/api/template/update_test.go index 5538ce27d..29a430dd7 100644 --- a/handler/api/template/update_test.go +++ b/handler/api/template/update_test.go @@ -10,15 +10,16 @@ import ( "bytes" "context" "encoding/json" + "net/http" + "net/http/httptest" + "testing" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/errors" "github.com/drone/drone/mock" "github.com/go-chi/chi" "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" - "net/http" - "net/http/httptest" - "testing" ) func TestHandleUpdate(t *testing.T) { diff --git a/plugin/converter/starlark.go b/plugin/converter/starlark.go index 5a1cb852d..86cca43c3 100644 --- a/plugin/converter/starlark.go +++ b/plugin/converter/starlark.go @@ -16,9 +16,10 @@ package converter import ( "context" + "strings" + "github.com/drone/drone/core" "github.com/drone/drone/plugin/converter/starlark" - "strings" ) // New returns a conversion service that converts the diff --git a/plugin/converter/starlark/starlark.go b/plugin/converter/starlark/starlark.go index e3040dfe8..c55c52c71 100644 --- a/plugin/converter/starlark/starlark.go +++ b/plugin/converter/starlark/starlark.go @@ -16,6 +16,7 @@ package starlark import ( "bytes" + "github.com/drone/drone/core" "github.com/drone/drone/handler/api/errors" "github.com/sirupsen/logrus" diff --git a/plugin/converter/template_test.go b/plugin/converter/template_test.go index 3615e3517..733dc27e2 100644 --- a/plugin/converter/template_test.go +++ b/plugin/converter/template_test.go @@ -15,11 +15,12 @@ package converter import ( + "io/ioutil" + "testing" + "github.com/drone/drone/core" "github.com/drone/drone/mock" "github.com/golang/mock/gomock" - "io/ioutil" - "testing" ) func TestTemplatePluginConvert(t *testing.T) { diff --git a/service/hook/parser/parse.go b/service/hook/parser/parse.go index 7176d91a1..91b409b06 100644 --- a/service/hook/parser/parse.go +++ b/service/hook/parser/parse.go @@ -84,7 +84,7 @@ func (p *parser) Parse(req *http.Request, secretFunc func(string) string) (*core os.Stderr.Write(out) } - // callback function provides the webhook parsers with + // callback function provides the webhook parser with // a per-repository secret key used to verify the webhook // payload signature for authenticity. fn := func(webhook scm.Webhook) (string, error) { diff --git a/store/template/template.go b/store/template/template.go index 6585de574..c0a330f5f 100644 --- a/store/template/template.go +++ b/store/template/template.go @@ -8,6 +8,7 @@ package template import ( "context" + "github.com/drone/drone/core" "github.com/drone/drone/store/shared/db" ) diff --git a/store/template/template_test.go b/store/template/template_test.go index c293239e0..4e777f9c2 100644 --- a/store/template/template_test.go +++ b/store/template/template_test.go @@ -9,9 +9,10 @@ package template import ( "context" "database/sql" + "testing" + "github.com/drone/drone/core" "github.com/drone/drone/store/shared/db/dbtest" - "testing" ) var noContext = context.TODO()