diff --git a/core/template.go b/core/template.go index 7d406bd2..29fccc87 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 370fadc4..837d67d3 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 33ceea53..e6022ee4 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 e4294f21..431476b5 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 66ae16ca..a69b9ec7 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 9fb9cd01..93e63c29 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 6b4bc853..1cb24905 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 9db1a5eb..a8ef6454 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 a600b435..c73150eb 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 6ddae146..dba3e13e 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 0f58b669..8a8f3510 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 5538ce27..29a430dd 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 5a1cb852..86cca43c 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 e3040dfe..c55c52c7 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 3615e351..733dc27e 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 7176d91a..91b409b0 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 6585de57..c0a330f5 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 c293239e..4e777f9c 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()