group imports
This commit is contained in:
parent
3b4d528ee9
commit
31867a9261
18 changed files with 43 additions and 26 deletions
|
@ -16,6 +16,7 @@ package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/drone/drone/handler/api/errors"
|
"github.com/drone/drone/handler/api/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
package template
|
package template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/render"
|
"github.com/drone/drone/handler/api/render"
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// HandleListAll returns an http.HandlerFunc that writes a json-encoded
|
// HandleListAll returns an http.HandlerFunc that writes a json-encoded
|
||||||
|
|
|
@ -9,15 +9,16 @@ package template
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httptest"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/errors"
|
"github.com/drone/drone/handler/api/errors"
|
||||||
"github.com/drone/drone/mock"
|
"github.com/drone/drone/mock"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"net/http"
|
|
||||||
"net/http/httptest"
|
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -8,9 +8,10 @@ package template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/render"
|
"github.com/drone/drone/handler/api/render"
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type templateInput struct {
|
type templateInput struct {
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
package template
|
package template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/render"
|
"github.com/drone/drone/handler/api/render"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// HandleDelete returns an http.HandlerFunc that processes http
|
// HandleDelete returns an http.HandlerFunc that processes http
|
||||||
|
|
|
@ -9,14 +9,15 @@ package template
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httptest"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/drone/drone/handler/api/errors"
|
"github.com/drone/drone/handler/api/errors"
|
||||||
"github.com/drone/drone/mock"
|
"github.com/drone/drone/mock"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"net/http"
|
|
||||||
"net/http/httptest"
|
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHandleDelete(t *testing.T) {
|
func TestHandleDelete(t *testing.T) {
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
package template
|
package template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/render"
|
"github.com/drone/drone/handler/api/render"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// HandleFind returns an http.HandlerFunc that writes json-encoded
|
// HandleFind returns an http.HandlerFunc that writes json-encoded
|
||||||
|
|
|
@ -9,14 +9,15 @@ package template
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httptest"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/drone/drone/handler/api/errors"
|
"github.com/drone/drone/handler/api/errors"
|
||||||
"github.com/drone/drone/mock"
|
"github.com/drone/drone/mock"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"net/http"
|
|
||||||
"net/http/httptest"
|
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHandleFind(t *testing.T) {
|
func TestHandleFind(t *testing.T) {
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
package template
|
package template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/render"
|
"github.com/drone/drone/handler/api/render"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// HandleList returns an http.HandlerFunc that writes a json-encoded
|
// HandleList returns an http.HandlerFunc that writes a json-encoded
|
||||||
|
|
|
@ -7,14 +7,15 @@ package template
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httptest"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/drone/drone/handler/api/errors"
|
"github.com/drone/drone/handler/api/errors"
|
||||||
"github.com/drone/drone/mock"
|
"github.com/drone/drone/mock"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"net/http"
|
|
||||||
"net/http/httptest"
|
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHandleList(t *testing.T) {
|
func TestHandleList(t *testing.T) {
|
||||||
|
|
|
@ -6,10 +6,11 @@ package template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/render"
|
"github.com/drone/drone/handler/api/render"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type templateUpdate struct {
|
type templateUpdate struct {
|
||||||
|
|
|
@ -10,15 +10,16 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httptest"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/errors"
|
"github.com/drone/drone/handler/api/errors"
|
||||||
"github.com/drone/drone/mock"
|
"github.com/drone/drone/mock"
|
||||||
"github.com/go-chi/chi"
|
"github.com/go-chi/chi"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"net/http"
|
|
||||||
"net/http/httptest"
|
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHandleUpdate(t *testing.T) {
|
func TestHandleUpdate(t *testing.T) {
|
||||||
|
|
|
@ -16,9 +16,10 @@ package converter
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/plugin/converter/starlark"
|
"github.com/drone/drone/plugin/converter/starlark"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a conversion service that converts the
|
// New returns a conversion service that converts the
|
||||||
|
|
|
@ -16,6 +16,7 @@ package starlark
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/handler/api/errors"
|
"github.com/drone/drone/handler/api/errors"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
|
|
@ -15,11 +15,12 @@
|
||||||
package converter
|
package converter
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/mock"
|
"github.com/drone/drone/mock"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"io/ioutil"
|
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTemplatePluginConvert(t *testing.T) {
|
func TestTemplatePluginConvert(t *testing.T) {
|
||||||
|
|
|
@ -84,7 +84,7 @@ func (p *parser) Parse(req *http.Request, secretFunc func(string) string) (*core
|
||||||
os.Stderr.Write(out)
|
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
|
// a per-repository secret key used to verify the webhook
|
||||||
// payload signature for authenticity.
|
// payload signature for authenticity.
|
||||||
fn := func(webhook scm.Webhook) (string, error) {
|
fn := func(webhook scm.Webhook) (string, error) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ package template
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/store/shared/db"
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,9 +9,10 @@ package template
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/store/shared/db/dbtest"
|
"github.com/drone/drone/store/shared/db/dbtest"
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var noContext = context.TODO()
|
var noContext = context.TODO()
|
||||||
|
|
Loading…
Reference in a new issue