diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-10-18 19:36:20 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2018-10-18 19:36:20 +0300 |
commit | 9586df22c2161e04a44360dfa00c1b8308099fc0 (patch) | |
tree | 4b5c3e2b1005f94fa782ce4f61b06ac3ec22330c | |
parent | 6e813b1b03c89db750c17ab77afe84eba4d13339 (diff) |
Group local go imports separatelyformat-gitaly-local
253 files changed, 663 insertions, 408 deletions
diff --git a/_support/makegen.go b/_support/makegen.go index e5f8b5ca0..33d056f94 100644 --- a/_support/makegen.go +++ b/_support/makegen.go @@ -69,8 +69,11 @@ func (gm *gitalyMake) BuildDir() string { return gm.cwd } -func (gm *gitalyMake) Pkg() string { return "gitlab.com/gitlab-org/gitaly" } -func (gm *gitalyMake) GoImports() string { return "bin/goimports" } +func (gm *gitalyMake) Pkg() string { return "gitlab.com/gitlab-org/gitaly" } +func (gm *gitalyMake) GoImports() string { return "bin/goimports" } +func (gm *gitalyMake) GoImportsFlags() string { + return fmt.Sprintf("-local %s,gitlab.com/gitlab-org/gitaly-proto", gm.Pkg()) +} func (gm *gitalyMake) GoCovMerge() string { return "bin/gocovmerge" } func (gm *gitalyMake) GoLint() string { return "bin/golint" } func (gm *gitalyMake) GoVendor() string { return "bin/govendor" } @@ -325,7 +328,7 @@ lint: {{ .GoLint }} .PHONY: check-formatting check-formatting: {{ .GoImports }} # goimports - @cd {{ .SourceDir }} && goimports -e -l {{ join .GoFiles " " }} | awk '{ print } END { if(NR>0) { print "Formatting error, run make format"; exit(1) } }' + @cd {{ .SourceDir }} && goimports {{ .GoImportsFlags }} -e -l {{ join .GoFiles " " }} | awk '{ print } END { if(NR>0) { print "Formatting error, run make format"; exit(1) } }' {{ .GoImports }}: go get golang.org/x/tools/cmd/goimports @@ -334,7 +337,7 @@ check-formatting: {{ .GoImports }} format: {{ .GoImports }} # In addition to fixing imports, goimports also formats your code in the same style as gofmt # so it can be used as a replacement. - @cd {{ .SourceDir }} && goimports -w -l {{ join .GoFiles " " }} + @cd {{ .SourceDir }} && goimports {{ .GoImportsFlags }} -w -l {{ join .GoFiles " " }} .PHONY: megacheck megacheck: {{ .MegaCheck }} diff --git a/client/receive_pack.go b/client/receive_pack.go index 767b392e5..9945814fd 100644 --- a/client/receive_pack.go +++ b/client/receive_pack.go @@ -3,10 +3,11 @@ package client import ( "io" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/streamio" "golang.org/x/net/context" "google.golang.org/grpc" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/streamio" ) // ReceivePack proxies an SSH git-receive-pack (git push) session to Gitaly diff --git a/client/upload_archive.go b/client/upload_archive.go index 2459519b3..d455f60b8 100644 --- a/client/upload_archive.go +++ b/client/upload_archive.go @@ -3,10 +3,11 @@ package client import ( "io" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/streamio" "golang.org/x/net/context" "google.golang.org/grpc" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/streamio" ) // UploadArchive proxies an SSH git-upload-archive (git archive --remote) session to Gitaly diff --git a/client/upload_pack.go b/client/upload_pack.go index 08372c5fc..95473c2c6 100644 --- a/client/upload_pack.go +++ b/client/upload_pack.go @@ -3,10 +3,11 @@ package client import ( "io" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/streamio" "golang.org/x/net/context" "google.golang.org/grpc" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/streamio" ) // UploadPack proxies an SSH git-upload-pack (git fetch) session to Gitaly diff --git a/cmd/gitaly-ssh/main.go b/cmd/gitaly-ssh/main.go index 048174133..a8f7d6050 100644 --- a/cmd/gitaly-ssh/main.go +++ b/cmd/gitaly-ssh/main.go @@ -4,9 +4,10 @@ import ( "log" "os" + "google.golang.org/grpc" + "gitlab.com/gitlab-org/gitaly/auth" "gitlab.com/gitlab-org/gitaly/client" - "google.golang.org/grpc" ) type packFn func(_, _ string) (int32, error) diff --git a/cmd/gitaly-ssh/receive_pack.go b/cmd/gitaly-ssh/receive_pack.go index 7008ee19a..6871c3d21 100644 --- a/cmd/gitaly-ssh/receive_pack.go +++ b/cmd/gitaly-ssh/receive_pack.go @@ -6,6 +6,7 @@ import ( "os" "github.com/golang/protobuf/jsonpb" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/client" ) diff --git a/cmd/gitaly-ssh/upload_archive.go b/cmd/gitaly-ssh/upload_archive.go index c7fa7356e..6a065cffa 100644 --- a/cmd/gitaly-ssh/upload_archive.go +++ b/cmd/gitaly-ssh/upload_archive.go @@ -6,6 +6,7 @@ import ( "os" "github.com/golang/protobuf/jsonpb" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/client" ) diff --git a/cmd/gitaly-ssh/upload_pack.go b/cmd/gitaly-ssh/upload_pack.go index cd3a26d83..599481fc7 100644 --- a/cmd/gitaly-ssh/upload_pack.go +++ b/cmd/gitaly-ssh/upload_pack.go @@ -6,6 +6,7 @@ import ( "os" "github.com/golang/protobuf/jsonpb" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/client" ) diff --git a/cmd/gitaly/main.go b/cmd/gitaly/main.go index 9bacea720..79389f720 100644 --- a/cmd/gitaly/main.go +++ b/cmd/gitaly/main.go @@ -12,6 +12,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" + "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/connectioncounter" "gitlab.com/gitlab-org/gitaly/internal/git" diff --git a/internal/command/command.go b/internal/command/command.go index bcd634ffe..735d4a227 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -13,6 +13,7 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "gitlab.com/gitlab-org/gitaly/internal/config" ) diff --git a/internal/config/prometheus.go b/internal/config/prometheus.go index 2d8936f9a..1577bffe8 100644 --- a/internal/config/prometheus.go +++ b/internal/config/prometheus.go @@ -4,6 +4,7 @@ import ( "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" + "gitlab.com/gitlab-org/gitaly/internal/middleware/limithandler" ) diff --git a/internal/config/sentry.go b/internal/config/sentry.go index f67169b83..00da806d5 100644 --- a/internal/config/sentry.go +++ b/internal/config/sentry.go @@ -5,6 +5,7 @@ import ( "github.com/getsentry/raven-go" log "github.com/sirupsen/logrus" + "gitlab.com/gitlab-org/gitaly/internal/middleware/panichandler" ) diff --git a/internal/git/catfile/batch.go b/internal/git/catfile/batch.go index c712b33a6..7848c4351 100644 --- a/internal/git/catfile/batch.go +++ b/internal/git/catfile/batch.go @@ -8,9 +8,10 @@ import ( "io/ioutil" "sync" - "gitlab.com/gitlab-org/gitaly/internal/git" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly/internal/git" ) // batch encapsulates a 'git cat-file --batch' process diff --git a/internal/git/catfile/batchcheck.go b/internal/git/catfile/batchcheck.go index 9dc3356ee..372319cc0 100644 --- a/internal/git/catfile/batchcheck.go +++ b/internal/git/catfile/batchcheck.go @@ -7,9 +7,10 @@ import ( "io" "sync" - "gitlab.com/gitlab-org/gitaly/internal/git" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly/internal/git" ) // batchCheck encapsulates a 'git cat-file --batch-check' process diff --git a/internal/git/catfile/catfile_test.go b/internal/git/catfile/catfile_test.go index 386f1d2b0..ac12b8c49 100644 --- a/internal/git/catfile/catfile_test.go +++ b/internal/git/catfile/catfile_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/git/log/commit.go b/internal/git/log/commit.go index 0ded22414..9b33afd24 100644 --- a/internal/git/log/commit.go +++ b/internal/git/log/commit.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/golang/protobuf/ptypes/timestamp" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" diff --git a/internal/git/log/commit_test.go b/internal/git/log/commit_test.go index b3144aced..3f3370c58 100644 --- a/internal/git/log/commit_test.go +++ b/internal/git/log/commit_test.go @@ -5,6 +5,7 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" ) diff --git a/internal/git/log/last_commit.go b/internal/git/log/last_commit.go index 872b5b2bd..91a8f1c72 100644 --- a/internal/git/log/last_commit.go +++ b/internal/git/log/last_commit.go @@ -7,6 +7,7 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" diff --git a/internal/helper/repo.go b/internal/helper/repo.go index 5397b2fca..79cb80d69 100644 --- a/internal/helper/repo.go +++ b/internal/helper/repo.go @@ -4,10 +4,11 @@ import ( "os" "path" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/config" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/config" ) // GetRepoPath returns the full path of the repository referenced by an diff --git a/internal/helper/repo_test.go b/internal/helper/repo_test.go index ca2c43cc2..6317e34f6 100644 --- a/internal/helper/repo_test.go +++ b/internal/helper/repo_test.go @@ -6,10 +6,11 @@ import ( "testing" "github.com/stretchr/testify/assert" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestGetRepoPath(t *testing.T) { diff --git a/internal/helper/storage.go b/internal/helper/storage.go index 5405421ce..bc39d3891 100644 --- a/internal/helper/storage.go +++ b/internal/helper/storage.go @@ -5,9 +5,10 @@ import ( "encoding/json" "fmt" - "gitlab.com/gitlab-org/gitaly/internal/storage" "golang.org/x/net/context" "google.golang.org/grpc/metadata" + + "gitlab.com/gitlab-org/gitaly/internal/storage" ) // ExtractGitalyServers extracts `storage.GitalyServers` from an incoming context. diff --git a/internal/helper/storage_test.go b/internal/helper/storage_test.go index d0f229e0e..ed8540e7e 100644 --- a/internal/helper/storage_test.go +++ b/internal/helper/storage_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly/internal/storage" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/metadata" ) func TestExtractGitalyServers(t *testing.T) { diff --git a/internal/linguist/linguist_test.go b/internal/linguist/linguist_test.go index aac91d866..9269db6d8 100644 --- a/internal/linguist/linguist_test.go +++ b/internal/linguist/linguist_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/middleware/limithandler/limithandler_test.go b/internal/middleware/limithandler/limithandler_test.go index ee5e24b10..27f393be7 100644 --- a/internal/middleware/limithandler/limithandler_test.go +++ b/internal/middleware/limithandler/limithandler_test.go @@ -7,11 +7,12 @@ import ( "time" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc" + "gitlab.com/gitlab-org/gitaly/internal/middleware/limithandler" pb "gitlab.com/gitlab-org/gitaly/internal/middleware/limithandler/testpb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc" ) func fixedLockKey(ctx context.Context) string { diff --git a/internal/middleware/limithandler/testhelper_test.go b/internal/middleware/limithandler/testhelper_test.go index 40eff4f01..81f0b3629 100644 --- a/internal/middleware/limithandler/testhelper_test.go +++ b/internal/middleware/limithandler/testhelper_test.go @@ -3,8 +3,9 @@ package limithandler_test import ( "sync/atomic" - pb "gitlab.com/gitlab-org/gitaly/internal/middleware/limithandler/testpb" "golang.org/x/net/context" + + pb "gitlab.com/gitlab-org/gitaly/internal/middleware/limithandler/testpb" ) type server struct { diff --git a/internal/middleware/metadatahandler/metadatahandler.go b/internal/middleware/metadatahandler/metadatahandler.go index 9cabc2840..696ca4596 100644 --- a/internal/middleware/metadatahandler/metadatahandler.go +++ b/internal/middleware/metadatahandler/metadatahandler.go @@ -3,11 +3,12 @@ package metadatahandler import ( "github.com/grpc-ecosystem/go-grpc-middleware/tags" "github.com/prometheus/client_golang/prometheus" - "gitlab.com/gitlab-org/gitaly/auth" - "gitlab.com/gitlab-org/gitaly/internal/helper" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + + "gitlab.com/gitlab-org/gitaly/auth" + "gitlab.com/gitlab-org/gitaly/internal/helper" ) var ( diff --git a/internal/middleware/sentryhandler/sentryhandler.go b/internal/middleware/sentryhandler/sentryhandler.go index 5deff9e0d..6d16500c5 100644 --- a/internal/middleware/sentryhandler/sentryhandler.go +++ b/internal/middleware/sentryhandler/sentryhandler.go @@ -7,10 +7,11 @@ import ( raven "github.com/getsentry/raven-go" "github.com/grpc-ecosystem/go-grpc-middleware/tags" - "gitlab.com/gitlab-org/gitaly/internal/helper" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly/internal/helper" ) var ignoredCodes = []codes.Code{ diff --git a/internal/rubyserver/concurrency_test.go b/internal/rubyserver/concurrency_test.go index e82311513..c7d783009 100644 --- a/internal/rubyserver/concurrency_test.go +++ b/internal/rubyserver/concurrency_test.go @@ -7,11 +7,12 @@ import ( "testing" "time" - "gitlab.com/gitlab-org/gitaly/internal/config" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc/codes" healthpb "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly/internal/config" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func waitPing(s *Server) error { diff --git a/internal/rubyserver/health_test.go b/internal/rubyserver/health_test.go index 5d513b85d..5c6c7ad32 100644 --- a/internal/rubyserver/health_test.go +++ b/internal/rubyserver/health_test.go @@ -5,6 +5,7 @@ import ( "time" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/rubyserver/proxy.go b/internal/rubyserver/proxy.go index 98fe4bc2f..612b6b4e8 100644 --- a/internal/rubyserver/proxy.go +++ b/internal/rubyserver/proxy.go @@ -6,9 +6,10 @@ import ( "os" "strings" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" - "google.golang.org/grpc/metadata" ) // ProxyHeaderWhitelist is the list of http/2 headers that will be diff --git a/internal/rubyserver/proxy_test.go b/internal/rubyserver/proxy_test.go index 5b804c061..a096a8280 100644 --- a/internal/rubyserver/proxy_test.go +++ b/internal/rubyserver/proxy_test.go @@ -4,8 +4,9 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc/metadata" + + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSetHeadersBlocksUnknownMetadata(t *testing.T) { diff --git a/internal/rubyserver/rubyserver.go b/internal/rubyserver/rubyserver.go index 46e935ca9..8c7c27c34 100644 --- a/internal/rubyserver/rubyserver.go +++ b/internal/rubyserver/rubyserver.go @@ -13,6 +13,9 @@ import ( "github.com/grpc-ecosystem/go-grpc-prometheus" log "github.com/sirupsen/logrus" + "golang.org/x/net/context" + "google.golang.org/grpc" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/config" @@ -21,8 +24,6 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/supervisor" "gitlab.com/gitlab-org/gitaly/internal/version" "gitlab.com/gitlab-org/gitaly/streamio" - "golang.org/x/net/context" - "google.golang.org/grpc" ) var ( diff --git a/internal/rubyserver/rubyserver_test.go b/internal/rubyserver/rubyserver_test.go index 68eddd548..8d7a266d7 100644 --- a/internal/rubyserver/rubyserver_test.go +++ b/internal/rubyserver/rubyserver_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/assert" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestStopSafe(t *testing.T) { diff --git a/internal/rubyserver/worker.go b/internal/rubyserver/worker.go index 4dd44ae8f..75768645a 100644 --- a/internal/rubyserver/worker.go +++ b/internal/rubyserver/worker.go @@ -7,6 +7,7 @@ import ( "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" + "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/rubyserver/balancer" "gitlab.com/gitlab-org/gitaly/internal/supervisor" diff --git a/internal/rubyserver/worker_test.go b/internal/rubyserver/worker_test.go index 5b0599b74..ad86e792a 100644 --- a/internal/rubyserver/worker_test.go +++ b/internal/rubyserver/worker_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/supervisor" ) diff --git a/internal/server/auth/auth.go b/internal/server/auth/auth.go index 33fb6eb92..87fb6a451 100644 --- a/internal/server/auth/auth.go +++ b/internal/server/auth/auth.go @@ -5,12 +5,13 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/auth" "github.com/prometheus/client_golang/prometheus" - "gitlab.com/gitlab-org/gitaly/auth" - "gitlab.com/gitlab-org/gitaly/internal/config" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly/auth" + "gitlab.com/gitlab-org/gitaly/internal/config" ) var ( diff --git a/internal/server/auth_test.go b/internal/server/auth_test.go index b50445a84..6741d2231 100644 --- a/internal/server/auth_test.go +++ b/internal/server/auth_test.go @@ -7,13 +7,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly/auth" - "gitlab.com/gitlab-org/gitaly/internal/config" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" netctx "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/codes" healthpb "google.golang.org/grpc/health/grpc_health_v1" + + "gitlab.com/gitlab-org/gitaly/auth" + "gitlab.com/gitlab-org/gitaly/internal/config" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSanity(t *testing.T) { diff --git a/internal/server/server.go b/internal/server/server.go index 3abcceaeb..0a181a93d 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -6,6 +6,10 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/tags" "github.com/grpc-ecosystem/go-grpc-prometheus" log "github.com/sirupsen/logrus" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly/internal/helper/fieldextractors" gitalylog "gitlab.com/gitlab-org/gitaly/internal/log" "gitlab.com/gitlab-org/gitaly/internal/logsanitizer" @@ -17,9 +21,6 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/server/auth" "gitlab.com/gitlab-org/gitaly/internal/service" - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) func concurrencyKeyFn(ctx context.Context) string { diff --git a/internal/service/blob/get_blob.go b/internal/service/blob/get_blob.go index 0069ec778..f518d0d91 100644 --- a/internal/service/blob/get_blob.go +++ b/internal/service/blob/get_blob.go @@ -4,12 +4,13 @@ import ( "fmt" "io" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) GetBlob(in *gitalypb.GetBlobRequest, stream gitalypb.BlobService_GetBlobServer) error { diff --git a/internal/service/blob/get_blob_test.go b/internal/service/blob/get_blob_test.go index 4f5bb7a37..3c31096e5 100644 --- a/internal/service/blob/get_blob_test.go +++ b/internal/service/blob/get_blob_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" diff --git a/internal/service/blob/get_blobs.go b/internal/service/blob/get_blobs.go index 4bb70ee5f..40c8c343e 100644 --- a/internal/service/blob/get_blobs.go +++ b/internal/service/blob/get_blobs.go @@ -4,12 +4,13 @@ import ( "io" "io/ioutil" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/internal/service/commit" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func sendGetBlobsResponse(req *gitalypb.GetBlobsRequest, stream gitalypb.BlobService_GetBlobsServer, c *catfile.Batch) error { diff --git a/internal/service/blob/get_blobs_test.go b/internal/service/blob/get_blobs_test.go index 85b0ca23d..925dd1a5e 100644 --- a/internal/service/blob/get_blobs_test.go +++ b/internal/service/blob/get_blobs_test.go @@ -7,9 +7,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulGetBlobsRequest(t *testing.T) { diff --git a/internal/service/blob/lfs_pointers.go b/internal/service/blob/lfs_pointers.go index e83fe3504..0f9dedd5e 100644 --- a/internal/service/blob/lfs_pointers.go +++ b/internal/service/blob/lfs_pointers.go @@ -3,11 +3,12 @@ package blob import ( "fmt" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) type getLFSPointerByRevisionRequest interface { diff --git a/internal/service/blob/lfs_pointers_test.go b/internal/service/blob/lfs_pointers_test.go index 3dedf32af..89324df64 100644 --- a/internal/service/blob/lfs_pointers_test.go +++ b/internal/service/blob/lfs_pointers_test.go @@ -6,9 +6,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulGetLFSPointersRequest(t *testing.T) { diff --git a/internal/service/blob/testhelper_test.go b/internal/service/blob/testhelper_test.go index 19a7bc534..f6044838b 100644 --- a/internal/service/blob/testhelper_test.go +++ b/internal/service/blob/testhelper_test.go @@ -7,11 +7,12 @@ import ( "testing" "time" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) var rubyServer *rubyserver.Server diff --git a/internal/service/commit/between.go b/internal/service/commit/between.go index be761556e..b3df8a285 100644 --- a/internal/service/commit/between.go +++ b/internal/service/commit/between.go @@ -3,10 +3,11 @@ package commit import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" ) type commitsBetweenSender struct { diff --git a/internal/service/commit/between_test.go b/internal/service/commit/between_test.go index 8f6fdd1cc..80d727255 100644 --- a/internal/service/commit/between_test.go +++ b/internal/service/commit/between_test.go @@ -6,10 +6,11 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSuccessfulCommitsBetween(t *testing.T) { diff --git a/internal/service/commit/commit_messages.go b/internal/service/commit/commit_messages.go index 7d041ae94..3168cce00 100644 --- a/internal/service/commit/commit_messages.go +++ b/internal/service/commit/commit_messages.go @@ -3,10 +3,11 @@ package commit import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) GetCommitMessages(request *gitalypb.GetCommitMessagesRequest, stream gitalypb.CommitService_GetCommitMessagesServer) error { diff --git a/internal/service/commit/commit_messages_test.go b/internal/service/commit/commit_messages_test.go index 48bda1007..22fb3e99a 100644 --- a/internal/service/commit/commit_messages_test.go +++ b/internal/service/commit/commit_messages_test.go @@ -6,10 +6,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulGetCommitMessagesRequest(t *testing.T) { diff --git a/internal/service/commit/commit_signatures.go b/internal/service/commit/commit_signatures.go index d6982a7af..896e55a08 100644 --- a/internal/service/commit/commit_signatures.go +++ b/internal/service/commit/commit_signatures.go @@ -3,10 +3,11 @@ package commit import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) GetCommitSignatures(request *gitalypb.GetCommitSignaturesRequest, stream gitalypb.CommitService_GetCommitSignaturesServer) error { diff --git a/internal/service/commit/commit_signatures_test.go b/internal/service/commit/commit_signatures_test.go index 69640cda5..ec8119bc6 100644 --- a/internal/service/commit/commit_signatures_test.go +++ b/internal/service/commit/commit_signatures_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulGetCommitSignaturesRequest(t *testing.T) { diff --git a/internal/service/commit/commits_by_message.go b/internal/service/commit/commits_by_message.go index a1a06fbdb..2e660ca68 100644 --- a/internal/service/commit/commits_by_message.go +++ b/internal/service/commit/commits_by_message.go @@ -3,9 +3,10 @@ package commit import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" ) type commitsByMessageSender struct { diff --git a/internal/service/commit/commits_by_message_test.go b/internal/service/commit/commits_by_message_test.go index ca183c3ef..b8ca23f3f 100644 --- a/internal/service/commit/commits_by_message_test.go +++ b/internal/service/commit/commits_by_message_test.go @@ -6,10 +6,11 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSuccessfulCommitsByMessageRequest(t *testing.T) { diff --git a/internal/service/commit/commits_helper.go b/internal/service/commit/commits_helper.go index 83b079070..78bfec02a 100644 --- a/internal/service/commit/commits_helper.go +++ b/internal/service/commit/commits_helper.go @@ -4,6 +4,7 @@ import ( "context" "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" ) diff --git a/internal/service/commit/count_commits.go b/internal/service/commit/count_commits.go index 1b4a96b32..fdc321c54 100644 --- a/internal/service/commit/count_commits.go +++ b/internal/service/commit/count_commits.go @@ -8,11 +8,12 @@ import ( "time" "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" ) func (s *server) CountCommits(ctx context.Context, in *gitalypb.CountCommitsRequest) (*gitalypb.CountCommitsResponse, error) { diff --git a/internal/service/commit/count_commits_test.go b/internal/service/commit/count_commits_test.go index ec0acae17..98f37e52c 100644 --- a/internal/service/commit/count_commits_test.go +++ b/internal/service/commit/count_commits_test.go @@ -7,10 +7,11 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSuccessfulCountCommitsRequest(t *testing.T) { diff --git a/internal/service/commit/extractsignature_test.go b/internal/service/commit/extractsignature_test.go index 786fde75f..543218a40 100644 --- a/internal/service/commit/extractsignature_test.go +++ b/internal/service/commit/extractsignature_test.go @@ -6,10 +6,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestExtractCommitSignatureSuccess(t *testing.T) { diff --git a/internal/service/commit/filter_shas_with_signatures.go b/internal/service/commit/filter_shas_with_signatures.go index 6e879169b..e0854156a 100644 --- a/internal/service/commit/filter_shas_with_signatures.go +++ b/internal/service/commit/filter_shas_with_signatures.go @@ -1,10 +1,11 @@ package commit import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) FilterShasWithSignatures(bidi gitalypb.CommitService_FilterShasWithSignaturesServer) error { diff --git a/internal/service/commit/filter_shas_with_signatures_test.go b/internal/service/commit/filter_shas_with_signatures_test.go index dbda54e65..138db94d2 100644 --- a/internal/service/commit/filter_shas_with_signatures_test.go +++ b/internal/service/commit/filter_shas_with_signatures_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestFilterShasWithSignaturesSuccessful(t *testing.T) { diff --git a/internal/service/commit/find_all_commits.go b/internal/service/commit/find_all_commits.go index e6fc1049d..e9f79b5cc 100644 --- a/internal/service/commit/find_all_commits.go +++ b/internal/service/commit/find_all_commits.go @@ -3,10 +3,11 @@ package commit import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/service/ref" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/service/ref" ) // We declare this function in variables so that we can override them in our tests diff --git a/internal/service/commit/find_all_commits_test.go b/internal/service/commit/find_all_commits_test.go index e1e696b52..1ffac64dc 100644 --- a/internal/service/commit/find_all_commits_test.go +++ b/internal/service/commit/find_all_commits_test.go @@ -6,11 +6,12 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/service/ref" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulFindAllCommitsRequest(t *testing.T) { diff --git a/internal/service/commit/find_commit.go b/internal/service/commit/find_commit.go index a0a474e9f..ea7fc1ac6 100644 --- a/internal/service/commit/find_commit.go +++ b/internal/service/commit/find_commit.go @@ -1,12 +1,13 @@ package commit import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" - "gitlab.com/gitlab-org/gitaly/internal/git/log" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/git/log" ) func (s *server) FindCommit(ctx context.Context, in *gitalypb.FindCommitRequest) (*gitalypb.FindCommitResponse, error) { diff --git a/internal/service/commit/find_commit_test.go b/internal/service/commit/find_commit_test.go index bdf8e35b2..4994e0ab8 100644 --- a/internal/service/commit/find_commit_test.go +++ b/internal/service/commit/find_commit_test.go @@ -7,15 +7,16 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/featureflag" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" ) func TestSuccessfulFindCommitRequest(t *testing.T) { diff --git a/internal/service/commit/find_commits.go b/internal/service/commit/find_commits.go index 6aa4d7298..20fae44f4 100644 --- a/internal/service/commit/find_commits.go +++ b/internal/service/commit/find_commits.go @@ -1,10 +1,11 @@ package commit import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) FindCommits(req *gitalypb.FindCommitsRequest, stream gitalypb.CommitService_FindCommitsServer) error { diff --git a/internal/service/commit/find_commits_test.go b/internal/service/commit/find_commits_test.go index 4027414e7..35d53a3ea 100644 --- a/internal/service/commit/find_commits_test.go +++ b/internal/service/commit/find_commits_test.go @@ -10,9 +10,10 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestFindCommitsFields(t *testing.T) { diff --git a/internal/service/commit/isancestor.go b/internal/service/commit/isancestor.go index 88be2ec0f..869f8db95 100644 --- a/internal/service/commit/isancestor.go +++ b/internal/service/commit/isancestor.go @@ -3,11 +3,12 @@ package commit import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" ) func (s *server) CommitIsAncestor(ctx context.Context, in *gitalypb.CommitIsAncestorRequest) (*gitalypb.CommitIsAncestorResponse, error) { diff --git a/internal/service/commit/isancestor_test.go b/internal/service/commit/isancestor_test.go index 1d958ef97..baa4f44c8 100644 --- a/internal/service/commit/isancestor_test.go +++ b/internal/service/commit/isancestor_test.go @@ -6,11 +6,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestCommitIsAncestorFailure(t *testing.T) { diff --git a/internal/service/commit/languages.go b/internal/service/commit/languages.go index 052de5bf9..5c15056a2 100644 --- a/internal/service/commit/languages.go +++ b/internal/service/commit/languages.go @@ -5,14 +5,15 @@ import ( "sort" "strings" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/linguist" "gitlab.com/gitlab-org/gitaly/internal/service/ref" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (*server) CommitLanguages(ctx context.Context, req *gitalypb.CommitLanguagesRequest) (*gitalypb.CommitLanguagesResponse, error) { diff --git a/internal/service/commit/languages_test.go b/internal/service/commit/languages_test.go index 2d82a7712..9a7ae5890 100644 --- a/internal/service/commit/languages_test.go +++ b/internal/service/commit/languages_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/service/commit/last_commit_for_path.go b/internal/service/commit/last_commit_for_path.go index 9cf65f39c..91986cb6f 100644 --- a/internal/service/commit/last_commit_for_path.go +++ b/internal/service/commit/last_commit_for_path.go @@ -3,11 +3,12 @@ package commit import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git/log" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git/log" ) func (s *server) LastCommitForPath(ctx context.Context, in *gitalypb.LastCommitForPathRequest) (*gitalypb.LastCommitForPathResponse, error) { diff --git a/internal/service/commit/last_commit_for_path_test.go b/internal/service/commit/last_commit_for_path_test.go index 33232e986..79e990617 100644 --- a/internal/service/commit/last_commit_for_path_test.go +++ b/internal/service/commit/last_commit_for_path_test.go @@ -5,10 +5,11 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSuccessfulLastCommitForPathRequest(t *testing.T) { diff --git a/internal/service/commit/list_commits_by_oid_test.go b/internal/service/commit/list_commits_by_oid_test.go index 2c994c9e2..f3d2be8a0 100644 --- a/internal/service/commit/list_commits_by_oid_test.go +++ b/internal/service/commit/list_commits_by_oid_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" ) func TestSuccessfulListCommitsByOidRequest(t *testing.T) { diff --git a/internal/service/commit/list_files.go b/internal/service/commit/list_files.go index 96d108a65..e1d5f1d49 100644 --- a/internal/service/commit/list_files.go +++ b/internal/service/commit/list_files.go @@ -5,12 +5,13 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/helper/lines" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) ListFiles(in *gitalypb.ListFilesRequest, stream gitalypb.CommitService_ListFilesServer) error { diff --git a/internal/service/commit/list_files_test.go b/internal/service/commit/list_files_test.go index d1eb82112..fd275ee9e 100644 --- a/internal/service/commit/list_files_test.go +++ b/internal/service/commit/list_files_test.go @@ -6,11 +6,12 @@ import ( "io" "testing" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/service/ref" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) var ( diff --git a/internal/service/commit/list_last_commits_for_tree.go b/internal/service/commit/list_last_commits_for_tree.go index 60d9c0952..c145bd0df 100644 --- a/internal/service/commit/list_last_commits_for_tree.go +++ b/internal/service/commit/list_last_commits_for_tree.go @@ -5,13 +5,14 @@ import ( "io" "sort" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/git/lstree" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var ( diff --git a/internal/service/commit/list_last_commits_for_tree_test.go b/internal/service/commit/list_last_commits_for_tree_test.go index ed7e30dd5..c8147c08b 100644 --- a/internal/service/commit/list_last_commits_for_tree_test.go +++ b/internal/service/commit/list_last_commits_for_tree_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) type commitInfo struct { diff --git a/internal/service/commit/raw_blame.go b/internal/service/commit/raw_blame.go index 7b00475e5..2c82fb2f9 100644 --- a/internal/service/commit/raw_blame.go +++ b/internal/service/commit/raw_blame.go @@ -5,11 +5,12 @@ import ( "io" "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) RawBlame(in *gitalypb.RawBlameRequest, stream gitalypb.CommitService_RawBlameServer) error { diff --git a/internal/service/commit/raw_blame_test.go b/internal/service/commit/raw_blame_test.go index 034176c83..8967c9745 100644 --- a/internal/service/commit/raw_blame_test.go +++ b/internal/service/commit/raw_blame_test.go @@ -6,11 +6,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulRawBlameRequest(t *testing.T) { diff --git a/internal/service/commit/stats.go b/internal/service/commit/stats.go index 30605c808..e8dc33fae 100644 --- a/internal/service/commit/stats.go +++ b/internal/service/commit/stats.go @@ -1,10 +1,11 @@ package commit import ( + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" ) func (s *server) CommitStats(ctx context.Context, in *gitalypb.CommitStatsRequest) (*gitalypb.CommitStatsResponse, error) { diff --git a/internal/service/commit/stats_test.go b/internal/service/commit/stats_test.go index f9c7e847a..93cbb67d0 100644 --- a/internal/service/commit/stats_test.go +++ b/internal/service/commit/stats_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/assert" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestCommitStatsSuccess(t *testing.T) { diff --git a/internal/service/commit/testhelper_test.go b/internal/service/commit/testhelper_test.go index 4747082cc..f5f79d4a4 100644 --- a/internal/service/commit/testhelper_test.go +++ b/internal/service/commit/testhelper_test.go @@ -8,12 +8,13 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" log "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/linguist" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) var () diff --git a/internal/service/commit/tree_entries.go b/internal/service/commit/tree_entries.go index 37b755e9b..bde45fe39 100644 --- a/internal/service/commit/tree_entries.go +++ b/internal/service/commit/tree_entries.go @@ -5,10 +5,11 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git/catfile" ) var maxTreeEntries = 1000 diff --git a/internal/service/commit/tree_entries_test.go b/internal/service/commit/tree_entries_test.go index 48a81a484..f8d310019 100644 --- a/internal/service/commit/tree_entries_test.go +++ b/internal/service/commit/tree_entries_test.go @@ -6,10 +6,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSuccessfulGetTreeEntries(t *testing.T) { diff --git a/internal/service/commit/tree_entry.go b/internal/service/commit/tree_entry.go index 0b054803d..5c3e9218e 100644 --- a/internal/service/commit/tree_entry.go +++ b/internal/service/commit/tree_entry.go @@ -5,12 +5,13 @@ import ( "io" "strings" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func sendTreeEntry(stream gitalypb.CommitService_TreeEntryServer, c *catfile.Batch, revision, path string, limit int64) error { diff --git a/internal/service/commit/tree_entry_test.go b/internal/service/commit/tree_entry_test.go index 5d9a34f13..33b681a9f 100644 --- a/internal/service/commit/tree_entry_test.go +++ b/internal/service/commit/tree_entry_test.go @@ -6,10 +6,11 @@ import ( "io" "testing" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) type treeEntry struct { diff --git a/internal/service/conflicts/list_conflict_files.go b/internal/service/conflicts/list_conflict_files.go index 0664feeb8..bd7155b9c 100644 --- a/internal/service/conflicts/list_conflict_files.go +++ b/internal/service/conflicts/list_conflict_files.go @@ -3,10 +3,11 @@ package conflicts import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) ListConflictFiles(in *gitalypb.ListConflictFilesRequest, stream gitalypb.ConflictsService_ListConflictFilesServer) error { diff --git a/internal/service/conflicts/list_conflict_files_test.go b/internal/service/conflicts/list_conflict_files_test.go index 1570535aa..add1b94a8 100644 --- a/internal/service/conflicts/list_conflict_files_test.go +++ b/internal/service/conflicts/list_conflict_files_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) type conflictFile struct { diff --git a/internal/service/conflicts/resolve_conflicts.go b/internal/service/conflicts/resolve_conflicts.go index 72416953a..156dc603a 100644 --- a/internal/service/conflicts/resolve_conflicts.go +++ b/internal/service/conflicts/resolve_conflicts.go @@ -3,10 +3,11 @@ package conflicts import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) ResolveConflicts(stream gitalypb.ConflictsService_ResolveConflictsServer) error { diff --git a/internal/service/conflicts/resolve_conflicts_test.go b/internal/service/conflicts/resolve_conflicts_test.go index 02c593c68..d633c23d8 100644 --- a/internal/service/conflicts/resolve_conflicts_test.go +++ b/internal/service/conflicts/resolve_conflicts_test.go @@ -6,14 +6,15 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" serverPkg "gitlab.com/gitlab-org/gitaly/internal/server" "gitlab.com/gitlab-org/gitaly/internal/service/conflicts" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" ) var ( diff --git a/internal/service/conflicts/testhelper_test.go b/internal/service/conflicts/testhelper_test.go index e58298096..df31c839f 100644 --- a/internal/service/conflicts/testhelper_test.go +++ b/internal/service/conflicts/testhelper_test.go @@ -7,11 +7,12 @@ import ( "time" log "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) func TestMain(m *testing.M) { diff --git a/internal/service/diff/commit.go b/internal/service/diff/commit.go index 5037d47db..6b3401052 100644 --- a/internal/service/diff/commit.go +++ b/internal/service/diff/commit.go @@ -6,11 +6,12 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/diff" "gitlab.com/gitlab-org/gitaly/internal/git" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) type requestWithLeftRightCommitIds interface { diff --git a/internal/service/diff/commit_test.go b/internal/service/diff/commit_test.go index 6c0feb938..f6bec20fd 100644 --- a/internal/service/diff/commit_test.go +++ b/internal/service/diff/commit_test.go @@ -7,11 +7,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/diff" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulCommitDiffRequest(t *testing.T) { diff --git a/internal/service/diff/numstat.go b/internal/service/diff/numstat.go index f6a1aecce..d7e9814d6 100644 --- a/internal/service/diff/numstat.go +++ b/internal/service/diff/numstat.go @@ -3,12 +3,13 @@ package diff import ( "io" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/diff" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var ( diff --git a/internal/service/diff/numstat_test.go b/internal/service/diff/numstat_test.go index cb38d17e8..1bdec3a0b 100644 --- a/internal/service/diff/numstat_test.go +++ b/internal/service/diff/numstat_test.go @@ -5,11 +5,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/diff" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulDiffStatsRequest(t *testing.T) { diff --git a/internal/service/diff/patch_test.go b/internal/service/diff/patch_test.go index dbe75c4f5..b849edfe9 100644 --- a/internal/service/diff/patch_test.go +++ b/internal/service/diff/patch_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/service/diff/raw.go b/internal/service/diff/raw.go index 73fde92e5..549d1767b 100644 --- a/internal/service/diff/raw.go +++ b/internal/service/diff/raw.go @@ -3,12 +3,13 @@ package diff import ( "io" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" - "gitlab.com/gitlab-org/gitaly/streamio" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/streamio" ) func (s *server) RawDiff(in *gitalypb.RawDiffRequest, stream gitalypb.DiffService_RawDiffServer) error { diff --git a/internal/service/diff/raw_test.go b/internal/service/diff/raw_test.go index e775d48dd..f8efefbb9 100644 --- a/internal/service/diff/raw_test.go +++ b/internal/service/diff/raw_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" ) func TestSuccessfulRawDiffRequest(t *testing.T) { diff --git a/internal/service/diff/testhelper_test.go b/internal/service/diff/testhelper_test.go index 29a370429..8ebad6943 100644 --- a/internal/service/diff/testhelper_test.go +++ b/internal/service/diff/testhelper_test.go @@ -7,11 +7,12 @@ import ( "time" log "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) func TestMain(m *testing.M) { diff --git a/internal/service/namespace/namespace.go b/internal/service/namespace/namespace.go index ef8abffe0..6d49342a5 100644 --- a/internal/service/namespace/namespace.go +++ b/internal/service/namespace/namespace.go @@ -4,11 +4,12 @@ import ( "os" "path" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/helper" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/helper" ) var noNameError = status.Errorf(codes.InvalidArgument, "Name: cannot be empty") diff --git a/internal/service/namespace/namespace_test.go b/internal/service/namespace/namespace_test.go index f5ac3471f..c8413b316 100644 --- a/internal/service/namespace/namespace_test.go +++ b/internal/service/namespace/namespace_test.go @@ -6,12 +6,13 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestMain(m *testing.M) { diff --git a/internal/service/namespace/testhelper_test.go b/internal/service/namespace/testhelper_test.go index 3e08713d0..e930fe65b 100644 --- a/internal/service/namespace/testhelper_test.go +++ b/internal/service/namespace/testhelper_test.go @@ -5,10 +5,11 @@ import ( "testing" "time" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc" "google.golang.org/grpc/reflection" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func runNamespaceServer(t *testing.T) (*grpc.Server, string) { diff --git a/internal/service/operations/branches.go b/internal/service/operations/branches.go index 9a8840ded..b13830f10 100644 --- a/internal/service/operations/branches.go +++ b/internal/service/operations/branches.go @@ -1,11 +1,12 @@ package operations import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) UserCreateBranch(ctx context.Context, req *gitalypb.UserCreateBranchRequest) (*gitalypb.UserCreateBranchResponse, error) { diff --git a/internal/service/operations/branches_test.go b/internal/service/operations/branches_test.go index ab6d8e5d5..e7d00da90 100644 --- a/internal/service/operations/branches_test.go +++ b/internal/service/operations/branches_test.go @@ -8,11 +8,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulUserCreateBranchRequest(t *testing.T) { diff --git a/internal/service/operations/cherry_pick.go b/internal/service/operations/cherry_pick.go index eaea55558..a009db64a 100644 --- a/internal/service/operations/cherry_pick.go +++ b/internal/service/operations/cherry_pick.go @@ -1,11 +1,12 @@ package operations import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) UserCherryPick(ctx context.Context, req *gitalypb.UserCherryPickRequest) (*gitalypb.UserCherryPickResponse, error) { diff --git a/internal/service/operations/cherry_pick_test.go b/internal/service/operations/cherry_pick_test.go index 6326419ca..fb6dcf1e8 100644 --- a/internal/service/operations/cherry_pick_test.go +++ b/internal/service/operations/cherry_pick_test.go @@ -8,14 +8,15 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" serverPkg "gitlab.com/gitlab-org/gitaly/internal/server" "gitlab.com/gitlab-org/gitaly/internal/service/operations" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" ) func TestSuccessfulUserCherryPickRequest(t *testing.T) { diff --git a/internal/service/operations/commit_files.go b/internal/service/operations/commit_files.go index e9496d1af..b4463c4a0 100644 --- a/internal/service/operations/commit_files.go +++ b/internal/service/operations/commit_files.go @@ -3,10 +3,11 @@ package operations import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) UserCommitFiles(stream gitalypb.OperationService_UserCommitFilesServer) error { diff --git a/internal/service/operations/commit_files_test.go b/internal/service/operations/commit_files_test.go index ec76bad83..17e65da61 100644 --- a/internal/service/operations/commit_files_test.go +++ b/internal/service/operations/commit_files_test.go @@ -8,12 +8,13 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/service/operations" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" ) var ( diff --git a/internal/service/operations/merge.go b/internal/service/operations/merge.go index 2e9470f5a..34c096e60 100644 --- a/internal/service/operations/merge.go +++ b/internal/service/operations/merge.go @@ -3,11 +3,12 @@ package operations import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) UserMergeBranch(bidi gitalypb.OperationService_UserMergeBranchServer) error { diff --git a/internal/service/operations/merge_test.go b/internal/service/operations/merge_test.go index 1fdea95db..12491d3f9 100644 --- a/internal/service/operations/merge_test.go +++ b/internal/service/operations/merge_test.go @@ -12,10 +12,11 @@ import ( "time" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) var ( diff --git a/internal/service/operations/rebase.go b/internal/service/operations/rebase.go index 1fa5ea341..97b8c704c 100644 --- a/internal/service/operations/rebase.go +++ b/internal/service/operations/rebase.go @@ -3,11 +3,12 @@ package operations import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) UserRebase(ctx context.Context, req *gitalypb.UserRebaseRequest) (*gitalypb.UserRebaseResponse, error) { diff --git a/internal/service/operations/rebase_test.go b/internal/service/operations/rebase_test.go index 18fca0c68..79c856817 100644 --- a/internal/service/operations/rebase_test.go +++ b/internal/service/operations/rebase_test.go @@ -8,11 +8,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/service/operations" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" ) func TestSuccessfulUserRebaseRequest(t *testing.T) { diff --git a/internal/service/operations/revert.go b/internal/service/operations/revert.go index 2c501c449..c58ffc49d 100644 --- a/internal/service/operations/revert.go +++ b/internal/service/operations/revert.go @@ -1,11 +1,12 @@ package operations import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) UserRevert(ctx context.Context, req *gitalypb.UserRevertRequest) (*gitalypb.UserRevertResponse, error) { diff --git a/internal/service/operations/revert_test.go b/internal/service/operations/revert_test.go index 340fb6416..08319fd4b 100644 --- a/internal/service/operations/revert_test.go +++ b/internal/service/operations/revert_test.go @@ -7,12 +7,13 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/service/operations" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" ) func TestSuccessfulUserRevertRequest(t *testing.T) { diff --git a/internal/service/operations/squash.go b/internal/service/operations/squash.go index 8e007f693..a62068f38 100644 --- a/internal/service/operations/squash.go +++ b/internal/service/operations/squash.go @@ -3,11 +3,12 @@ package operations import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) UserSquash(ctx context.Context, req *gitalypb.UserSquashRequest) (*gitalypb.UserSquashResponse, error) { diff --git a/internal/service/operations/squash_test.go b/internal/service/operations/squash_test.go index 29d13183c..01a7d137c 100644 --- a/internal/service/operations/squash_test.go +++ b/internal/service/operations/squash_test.go @@ -4,10 +4,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) var ( diff --git a/internal/service/operations/tags.go b/internal/service/operations/tags.go index 09827d81a..08f0ea1fb 100644 --- a/internal/service/operations/tags.go +++ b/internal/service/operations/tags.go @@ -1,9 +1,10 @@ package operations import ( + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" ) func (s *server) UserDeleteTag(ctx context.Context, req *gitalypb.UserDeleteTagRequest) (*gitalypb.UserDeleteTagResponse, error) { diff --git a/internal/service/operations/tags_test.go b/internal/service/operations/tags_test.go index 385711a11..15491d8ed 100644 --- a/internal/service/operations/tags_test.go +++ b/internal/service/operations/tags_test.go @@ -9,10 +9,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulUserDeleteTagRequest(t *testing.T) { diff --git a/internal/service/operations/testhelper_test.go b/internal/service/operations/testhelper_test.go index a00079868..abbe7aa75 100644 --- a/internal/service/operations/testhelper_test.go +++ b/internal/service/operations/testhelper_test.go @@ -11,11 +11,12 @@ import ( log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) var ( diff --git a/internal/service/operations/update_branches_test.go b/internal/service/operations/update_branches_test.go index 6cc0aac1f..5bb025cfd 100644 --- a/internal/service/operations/update_branches_test.go +++ b/internal/service/operations/update_branches_test.go @@ -7,11 +7,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) var ( diff --git a/internal/service/ref/branches.go b/internal/service/ref/branches.go index 6d03816f7..655b21de4 100644 --- a/internal/service/ref/branches.go +++ b/internal/service/ref/branches.go @@ -1,9 +1,10 @@ package ref import ( + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" ) func (s *server) CreateBranch(ctx context.Context, req *gitalypb.CreateBranchRequest) (*gitalypb.CreateBranchResponse, error) { diff --git a/internal/service/ref/branches_test.go b/internal/service/ref/branches_test.go index 104ff21a7..de7937962 100644 --- a/internal/service/ref/branches_test.go +++ b/internal/service/ref/branches_test.go @@ -6,10 +6,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulCreateBranchRequest(t *testing.T) { diff --git a/internal/service/ref/delete_refs.go b/internal/service/ref/delete_refs.go index 27d9f9211..4671adeec 100644 --- a/internal/service/ref/delete_refs.go +++ b/internal/service/ref/delete_refs.go @@ -3,11 +3,12 @@ package ref import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) DeleteRefs(ctx context.Context, in *gitalypb.DeleteRefsRequest) (*gitalypb.DeleteRefsResponse, error) { diff --git a/internal/service/ref/delete_refs_test.go b/internal/service/ref/delete_refs_test.go index a87318cf0..ea65c2a3c 100644 --- a/internal/service/ref/delete_refs_test.go +++ b/internal/service/ref/delete_refs_test.go @@ -4,9 +4,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulDeleteRefs(t *testing.T) { diff --git a/internal/service/ref/list_new_blobs.go b/internal/service/ref/list_new_blobs.go index ff3dcd3a9..53acd16d5 100644 --- a/internal/service/ref/list_new_blobs.go +++ b/internal/service/ref/list_new_blobs.go @@ -6,11 +6,12 @@ import ( "regexp" "strings" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) ListNewBlobs(in *gitalypb.ListNewBlobsRequest, stream gitalypb.RefService_ListNewBlobsServer) error { diff --git a/internal/service/ref/list_new_blobs_test.go b/internal/service/ref/list_new_blobs_test.go index 7ad96f26e..eb8a2a142 100644 --- a/internal/service/ref/list_new_blobs_test.go +++ b/internal/service/ref/list_new_blobs_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestListNewBlobs(t *testing.T) { diff --git a/internal/service/ref/list_new_commits.go b/internal/service/ref/list_new_commits.go index 4fb50c6f6..4aed59719 100644 --- a/internal/service/ref/list_new_commits.go +++ b/internal/service/ref/list_new_commits.go @@ -3,12 +3,13 @@ package ref import ( "bufio" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/internal/git/log" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) ListNewCommits(in *gitalypb.ListNewCommitsRequest, stream gitalypb.RefService_ListNewCommitsServer) error { diff --git a/internal/service/ref/list_new_commits_test.go b/internal/service/ref/list_new_commits_test.go index 2bc13b3ab..6e4d2d0b1 100644 --- a/internal/service/ref/list_new_commits_test.go +++ b/internal/service/ref/list_new_commits_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestListNewCommits(t *testing.T) { diff --git a/internal/service/ref/refexists.go b/internal/service/ref/refexists.go index 819ff656a..3bbaf6898 100644 --- a/internal/service/ref/refexists.go +++ b/internal/service/ref/refexists.go @@ -5,12 +5,13 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/command" - "gitlab.com/gitlab-org/gitaly/internal/git" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/command" + "gitlab.com/gitlab-org/gitaly/internal/git" ) // RefExists returns true if the given reference exists. The ref must start with the string `ref/` diff --git a/internal/service/ref/refexists_test.go b/internal/service/ref/refexists_test.go index 44fa71d93..69e4bdf44 100644 --- a/internal/service/ref/refexists_test.go +++ b/internal/service/ref/refexists_test.go @@ -3,10 +3,11 @@ package ref import ( "testing" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestRefExists(t *testing.T) { diff --git a/internal/service/ref/refname.go b/internal/service/ref/refname.go index accf22f7e..7766afd75 100644 --- a/internal/service/ref/refname.go +++ b/internal/service/ref/refname.go @@ -6,11 +6,12 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" ) // FindRefName returns a ref that starts with the given prefix, if one exists. diff --git a/internal/service/ref/refname_test.go b/internal/service/ref/refname_test.go index 497135a25..56dc03ec0 100644 --- a/internal/service/ref/refname_test.go +++ b/internal/service/ref/refname_test.go @@ -3,11 +3,12 @@ package ref import ( "testing" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestFindRefNameSuccess(t *testing.T) { diff --git a/internal/service/ref/refs.go b/internal/service/ref/refs.go index 904723183..63cdec1b5 100644 --- a/internal/service/ref/refs.go +++ b/internal/service/ref/refs.go @@ -9,14 +9,15 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/internal/helper/lines" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var ( diff --git a/internal/service/ref/refs_test.go b/internal/service/ref/refs_test.go index f675c2c9a..5bdce30bf 100644 --- a/internal/service/ref/refs_test.go +++ b/internal/service/ref/refs_test.go @@ -9,12 +9,13 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func containsRef(refs [][]byte, ref string) bool { diff --git a/internal/service/ref/remote_branches.go b/internal/service/ref/remote_branches.go index ef582663b..d4187326f 100644 --- a/internal/service/ref/remote_branches.go +++ b/internal/service/ref/remote_branches.go @@ -4,10 +4,11 @@ import ( "fmt" "strings" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git/catfile" ) func (s *server) FindAllRemoteBranches(req *gitalypb.FindAllRemoteBranchesRequest, stream gitalypb.RefService_FindAllRemoteBranchesServer) error { diff --git a/internal/service/ref/remote_branches_test.go b/internal/service/ref/remote_branches_test.go index efb411342..4147e0210 100644 --- a/internal/service/ref/remote_branches_test.go +++ b/internal/service/ref/remote_branches_test.go @@ -5,11 +5,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulFindAllRemoteBranchesRequest(t *testing.T) { diff --git a/internal/service/ref/tag_messages.go b/internal/service/ref/tag_messages.go index 574d2c859..349027e04 100644 --- a/internal/service/ref/tag_messages.go +++ b/internal/service/ref/tag_messages.go @@ -3,10 +3,11 @@ package ref import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) GetTagMessages(request *gitalypb.GetTagMessagesRequest, stream gitalypb.RefService_GetTagMessagesServer) error { diff --git a/internal/service/ref/tag_messages_test.go b/internal/service/ref/tag_messages_test.go index cb1b0117e..1ca176393 100644 --- a/internal/service/ref/tag_messages_test.go +++ b/internal/service/ref/tag_messages_test.go @@ -6,10 +6,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulGetTagMessagesRequest(t *testing.T) { diff --git a/internal/service/ref/testhelper_test.go b/internal/service/ref/testhelper_test.go index 10cfa05e7..8bd8bf84f 100644 --- a/internal/service/ref/testhelper_test.go +++ b/internal/service/ref/testhelper_test.go @@ -10,12 +10,13 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper/lines" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) var ( diff --git a/internal/service/ref/util.go b/internal/service/ref/util.go index f40221d47..53c977cc6 100644 --- a/internal/service/ref/util.go +++ b/internal/service/ref/util.go @@ -3,12 +3,13 @@ package ref import ( "bytes" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/helper/lines" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var localBranchFormatFields = []string{"%(refname)", "%(objectname)"} diff --git a/internal/service/ref/util_test.go b/internal/service/ref/util_test.go index 331d2f570..fc74e91cd 100644 --- a/internal/service/ref/util_test.go +++ b/internal/service/ref/util_test.go @@ -5,6 +5,7 @@ import ( "github.com/golang/protobuf/ptypes/timestamp" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" ) diff --git a/internal/service/register.go b/internal/service/register.go index 49190bc2b..77f4f6445 100644 --- a/internal/service/register.go +++ b/internal/service/register.go @@ -1,6 +1,10 @@ package service import ( + "google.golang.org/grpc" + "google.golang.org/grpc/health" + healthpb "google.golang.org/grpc/health/grpc_health_v1" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/service/blob" @@ -17,9 +21,6 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/service/ssh" "gitlab.com/gitlab-org/gitaly/internal/service/storage" "gitlab.com/gitlab-org/gitaly/internal/service/wiki" - "google.golang.org/grpc" - "google.golang.org/grpc/health" - healthpb "google.golang.org/grpc/health/grpc_health_v1" ) // RegisterAll will register all the known grpc services with diff --git a/internal/service/remote/fetch_internal_remote.go b/internal/service/remote/fetch_internal_remote.go index 15961aa29..36e550b16 100644 --- a/internal/service/remote/fetch_internal_remote.go +++ b/internal/service/remote/fetch_internal_remote.go @@ -3,11 +3,12 @@ package remote import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) // FetchInternalRemote fetches another Gitaly repository set as a remote diff --git a/internal/service/remote/fetch_internal_remote_test.go b/internal/service/remote/fetch_internal_remote_test.go index 22bfab29c..b0766a9ac 100644 --- a/internal/service/remote/fetch_internal_remote_test.go +++ b/internal/service/remote/fetch_internal_remote_test.go @@ -6,13 +6,14 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" serverPkg "gitlab.com/gitlab-org/gitaly/internal/server" "gitlab.com/gitlab-org/gitaly/internal/service/remote" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" ) func TestSuccessfulFetchInternalRemote(t *testing.T) { diff --git a/internal/service/remote/find_remote_root_ref.go b/internal/service/remote/find_remote_root_ref.go index 56602be8d..aac0527f2 100644 --- a/internal/service/remote/find_remote_root_ref.go +++ b/internal/service/remote/find_remote_root_ref.go @@ -4,11 +4,12 @@ import ( "bufio" "strings" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" ) const headPrefix = "HEAD branch: " diff --git a/internal/service/remote/find_remote_root_ref_test.go b/internal/service/remote/find_remote_root_ref_test.go index a37a597e5..9ded98fdb 100644 --- a/internal/service/remote/find_remote_root_ref_test.go +++ b/internal/service/remote/find_remote_root_ref_test.go @@ -4,9 +4,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestFindRemoteRootRefSuccess(t *testing.T) { diff --git a/internal/service/remote/remotes.go b/internal/service/remote/remotes.go index 45fda5caa..2e0a2c2d0 100644 --- a/internal/service/remote/remotes.go +++ b/internal/service/remote/remotes.go @@ -6,12 +6,13 @@ import ( "io/ioutil" "strings" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) // AddRemote adds a remote to the repository diff --git a/internal/service/remote/remotes_test.go b/internal/service/remote/remotes_test.go index b38f9398e..0b404ce3d 100644 --- a/internal/service/remote/remotes_test.go +++ b/internal/service/remote/remotes_test.go @@ -9,10 +9,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSuccessfulAddRemote(t *testing.T) { diff --git a/internal/service/remote/testhelper_test.go b/internal/service/remote/testhelper_test.go index 152c5b2be..9a729e178 100644 --- a/internal/service/remote/testhelper_test.go +++ b/internal/service/remote/testhelper_test.go @@ -7,11 +7,12 @@ import ( "testing" "time" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) var RubyServer *rubyserver.Server diff --git a/internal/service/remote/update_remote_mirror.go b/internal/service/remote/update_remote_mirror.go index a35441928..d84b3b74f 100644 --- a/internal/service/remote/update_remote_mirror.go +++ b/internal/service/remote/update_remote_mirror.go @@ -3,10 +3,11 @@ package remote import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) UpdateRemoteMirror(stream gitalypb.RemoteService_UpdateRemoteMirrorServer) error { diff --git a/internal/service/remote/update_remote_mirror_test.go b/internal/service/remote/update_remote_mirror_test.go index e382dc5e0..79d6710f8 100644 --- a/internal/service/remote/update_remote_mirror_test.go +++ b/internal/service/remote/update_remote_mirror_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestSuccessfulUpdateRemoteMirrorRequest(t *testing.T) { diff --git a/internal/service/repository/apply_gitattributes.go b/internal/service/repository/apply_gitattributes.go index e7103f03b..5ece5405d 100644 --- a/internal/service/repository/apply_gitattributes.go +++ b/internal/service/repository/apply_gitattributes.go @@ -7,13 +7,14 @@ import ( "os" "path" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/internal/helper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func applyGitattributes(c *catfile.Batch, repoPath string, revision []byte) error { diff --git a/internal/service/repository/apply_gitattributes_test.go b/internal/service/repository/apply_gitattributes_test.go index c51889d92..eec00ac4e 100644 --- a/internal/service/repository/apply_gitattributes_test.go +++ b/internal/service/repository/apply_gitattributes_test.go @@ -8,9 +8,10 @@ import ( "testing" "github.com/stretchr/testify/assert" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestApplyGitattributesSuccess(t *testing.T) { diff --git a/internal/service/repository/archive.go b/internal/service/repository/archive.go index 0b871226b..b32685cf6 100644 --- a/internal/service/repository/archive.go +++ b/internal/service/repository/archive.go @@ -5,12 +5,13 @@ import ( "io" "os/exec" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func parseArchiveFormat(format gitalypb.GetArchiveRequest_Format) (*exec.Cmd, string) { diff --git a/internal/service/repository/archive_test.go b/internal/service/repository/archive_test.go index e0ba5ff9e..4e130d331 100644 --- a/internal/service/repository/archive_test.go +++ b/internal/service/repository/archive_test.go @@ -7,10 +7,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" ) func TestGetArchiveSuccess(t *testing.T) { diff --git a/internal/service/repository/backup_custom_hooks.go b/internal/service/repository/backup_custom_hooks.go index ce4354f2a..053f496cd 100644 --- a/internal/service/repository/backup_custom_hooks.go +++ b/internal/service/repository/backup_custom_hooks.go @@ -5,12 +5,13 @@ import ( "os/exec" "path" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) const customHooksDir = "custom_hooks" diff --git a/internal/service/repository/backup_custom_hooks_test.go b/internal/service/repository/backup_custom_hooks_test.go index 33816b823..ab61e6524 100644 --- a/internal/service/repository/backup_custom_hooks_test.go +++ b/internal/service/repository/backup_custom_hooks_test.go @@ -11,6 +11,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" diff --git a/internal/service/repository/calculate_checksum.go b/internal/service/repository/calculate_checksum.go index d58a6627d..d238084f8 100644 --- a/internal/service/repository/calculate_checksum.go +++ b/internal/service/repository/calculate_checksum.go @@ -9,13 +9,14 @@ import ( "regexp" "strings" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/alternates" "gitlab.com/gitlab-org/gitaly/internal/helper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) const blankChecksum = "0000000000000000000000000000000000000000" diff --git a/internal/service/repository/calculate_checksum_test.go b/internal/service/repository/calculate_checksum_test.go index 76f99902d..7816d1035 100644 --- a/internal/service/repository/calculate_checksum_test.go +++ b/internal/service/repository/calculate_checksum_test.go @@ -7,9 +7,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulCalculateChecksum(t *testing.T) { diff --git a/internal/service/repository/cleanup.go b/internal/service/repository/cleanup.go index 99fd9d343..03cd50f6c 100644 --- a/internal/service/repository/cleanup.go +++ b/internal/service/repository/cleanup.go @@ -7,11 +7,12 @@ import ( "strings" "time" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/helper" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/helper" ) var lockFiles = []string{"config.lock", "HEAD.lock"} diff --git a/internal/service/repository/cleanup_test.go b/internal/service/repository/cleanup_test.go index da88cce37..fa75ce319 100644 --- a/internal/service/repository/cleanup_test.go +++ b/internal/service/repository/cleanup_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/service/repository/config.go b/internal/service/repository/config.go index 30314f432..4d1e83f13 100644 --- a/internal/service/repository/config.go +++ b/internal/service/repository/config.go @@ -1,13 +1,14 @@ package repository import ( + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (*server) DeleteConfig(ctx context.Context, req *gitalypb.DeleteConfigRequest) (*gitalypb.DeleteConfigResponse, error) { diff --git a/internal/service/repository/config_test.go b/internal/service/repository/config_test.go index b39c4c457..fa885805a 100644 --- a/internal/service/repository/config_test.go +++ b/internal/service/repository/config_test.go @@ -7,10 +7,11 @@ import ( "testing" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestDeleteConfig(t *testing.T) { diff --git a/internal/service/repository/create.go b/internal/service/repository/create.go index 58928b166..1a70665a5 100644 --- a/internal/service/repository/create.go +++ b/internal/service/repository/create.go @@ -1,9 +1,10 @@ package repository import ( + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" ) func (s *server) CreateRepository(ctx context.Context, req *gitalypb.CreateRepositoryRequest) (*gitalypb.CreateRepositoryResponse, error) { diff --git a/internal/service/repository/create_bundle.go b/internal/service/repository/create_bundle.go index ee1fed758..8c63a9408 100644 --- a/internal/service/repository/create_bundle.go +++ b/internal/service/repository/create_bundle.go @@ -3,11 +3,12 @@ package repository import ( "io" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) CreateBundle(req *gitalypb.CreateBundleRequest, stream gitalypb.RepositoryService_CreateBundleServer) error { diff --git a/internal/service/repository/create_bundle_test.go b/internal/service/repository/create_bundle_test.go index b0582c14e..750462670 100644 --- a/internal/service/repository/create_bundle_test.go +++ b/internal/service/repository/create_bundle_test.go @@ -7,11 +7,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/tempdir" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" ) func TestSuccessfulCreateBundleRequest(t *testing.T) { diff --git a/internal/service/repository/create_from_bundle.go b/internal/service/repository/create_from_bundle.go index dffb329c1..4f8200b79 100644 --- a/internal/service/repository/create_from_bundle.go +++ b/internal/service/repository/create_from_bundle.go @@ -7,13 +7,14 @@ import ( "path" "strings" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/tempdir" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) CreateRepositoryFromBundle(stream gitalypb.RepositoryService_CreateRepositoryFromBundleServer) error { diff --git a/internal/service/repository/create_from_bundle_test.go b/internal/service/repository/create_from_bundle_test.go index 7c8a2f3c4..4adec6ad1 100644 --- a/internal/service/repository/create_from_bundle_test.go +++ b/internal/service/repository/create_from_bundle_test.go @@ -8,13 +8,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/tempdir" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" ) func TestSuccessfulCreateRepositoryFromBundleRequest(t *testing.T) { diff --git a/internal/service/repository/create_from_snapshot.go b/internal/service/repository/create_from_snapshot.go index 4d02bb1d0..fd539c0bc 100644 --- a/internal/service/repository/create_from_snapshot.go +++ b/internal/service/repository/create_from_snapshot.go @@ -7,13 +7,14 @@ import ( "os/exec" "time" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/tempdir" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) // httpTransport defines a http.Transport with values that are more restrictive diff --git a/internal/service/repository/create_from_snapshot_test.go b/internal/service/repository/create_from_snapshot_test.go index a308e0e9f..1f1654e2c 100644 --- a/internal/service/repository/create_from_snapshot_test.go +++ b/internal/service/repository/create_from_snapshot_test.go @@ -11,10 +11,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/archive" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) var ( diff --git a/internal/service/repository/create_from_url.go b/internal/service/repository/create_from_url.go index 7274bf7f0..7a8a4cdc7 100644 --- a/internal/service/repository/create_from_url.go +++ b/internal/service/repository/create_from_url.go @@ -4,12 +4,13 @@ import ( "fmt" "os" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" - "gitlab.com/gitlab-org/gitaly/internal/helper" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/helper" ) func (s *server) CreateRepositoryFromURL(ctx context.Context, req *gitalypb.CreateRepositoryFromURLRequest) (*gitalypb.CreateRepositoryFromURLResponse, error) { diff --git a/internal/service/repository/create_from_url_test.go b/internal/service/repository/create_from_url_test.go index c50aec953..a69955017 100644 --- a/internal/service/repository/create_from_url_test.go +++ b/internal/service/repository/create_from_url_test.go @@ -7,10 +7,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulCreateRepositoryFromURLRequest(t *testing.T) { diff --git a/internal/service/repository/create_test.go b/internal/service/repository/create_test.go index 7a36c40f7..6a906180e 100644 --- a/internal/service/repository/create_test.go +++ b/internal/service/repository/create_test.go @@ -7,11 +7,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestCreateRepositorySuccess(t *testing.T) { diff --git a/internal/service/repository/fetch.go b/internal/service/repository/fetch.go index f09488893..92e485a01 100644 --- a/internal/service/repository/fetch.go +++ b/internal/service/repository/fetch.go @@ -1,9 +1,10 @@ package repository import ( + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" ) func (s *server) FetchSourceBranch(ctx context.Context, req *gitalypb.FetchSourceBranchRequest) (*gitalypb.FetchSourceBranchResponse, error) { diff --git a/internal/service/repository/fetch_remote.go b/internal/service/repository/fetch_remote.go index e6dfd9de1..6527735a2 100644 --- a/internal/service/repository/fetch_remote.go +++ b/internal/service/repository/fetch_remote.go @@ -3,9 +3,10 @@ package repository import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" ) func (s *server) FetchRemote(ctx context.Context, in *gitalypb.FetchRemoteRequest) (*gitalypb.FetchRemoteResponse, error) { diff --git a/internal/service/repository/fetch_remote_test.go b/internal/service/repository/fetch_remote_test.go index 2a8ee4f1b..981624ac6 100644 --- a/internal/service/repository/fetch_remote_test.go +++ b/internal/service/repository/fetch_remote_test.go @@ -7,10 +7,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func copyRepoWithNewRemote(t *testing.T, repo *gitalypb.Repository, remote string) *gitalypb.Repository { diff --git a/internal/service/repository/fetch_test.go b/internal/service/repository/fetch_test.go index a20160ad0..6cca2e5f0 100644 --- a/internal/service/repository/fetch_test.go +++ b/internal/service/repository/fetch_test.go @@ -7,16 +7,17 @@ import ( "time" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + healthpb "google.golang.org/grpc/health/grpc_health_v1" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" gitLog "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/helper" serverPkg "gitlab.com/gitlab-org/gitaly/internal/server" "gitlab.com/gitlab-org/gitaly/internal/service/repository" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - healthpb "google.golang.org/grpc/health/grpc_health_v1" - "google.golang.org/grpc/metadata" ) func TestFetchSourceBranchSourceRepositorySuccess(t *testing.T) { diff --git a/internal/service/repository/fork.go b/internal/service/repository/fork.go index 3cfef7738..edb5b70f4 100644 --- a/internal/service/repository/fork.go +++ b/internal/service/repository/fork.go @@ -6,13 +6,14 @@ import ( "path" "github.com/golang/protobuf/jsonpb" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) const gitalyInternalURL = "ssh://gitaly/internal.git" diff --git a/internal/service/repository/fork_test.go b/internal/service/repository/fork_test.go index 813f0edff..850063e01 100644 --- a/internal/service/repository/fork_test.go +++ b/internal/service/repository/fork_test.go @@ -7,12 +7,13 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/service/repository" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" ) func TestSuccessfulCreateForkRequest(t *testing.T) { diff --git a/internal/service/repository/fsck.go b/internal/service/repository/fsck.go index 2e4f4195e..44ec145d2 100644 --- a/internal/service/repository/fsck.go +++ b/internal/service/repository/fsck.go @@ -3,10 +3,11 @@ package repository import ( "bytes" + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/alternates" - "golang.org/x/net/context" ) func (s *server) Fsck(ctx context.Context, req *gitalypb.FsckRequest) (*gitalypb.FsckResponse, error) { diff --git a/internal/service/repository/fsck_test.go b/internal/service/repository/fsck_test.go index a1c6ca850..a52c4c04a 100644 --- a/internal/service/repository/fsck_test.go +++ b/internal/service/repository/fsck_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/service/repository/gc.go b/internal/service/repository/gc.go index b6ac14e17..4e23d9a98 100644 --- a/internal/service/repository/gc.go +++ b/internal/service/repository/gc.go @@ -3,13 +3,14 @@ package repository import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/helper/housekeeping" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (server) GarbageCollect(ctx context.Context, in *gitalypb.GarbageCollectRequest) (*gitalypb.GarbageCollectResponse, error) { diff --git a/internal/service/repository/gc_test.go b/internal/service/repository/gc_test.go index d718c3229..15e5c97e3 100644 --- a/internal/service/repository/gc_test.go +++ b/internal/service/repository/gc_test.go @@ -12,9 +12,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) var ( diff --git a/internal/service/repository/info_attributes.go b/internal/service/repository/info_attributes.go index bbd423652..c09779ea1 100644 --- a/internal/service/repository/info_attributes.go +++ b/internal/service/repository/info_attributes.go @@ -5,11 +5,12 @@ import ( "os" "path" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) GetInfoAttributes(in *gitalypb.GetInfoAttributesRequest, stream gitalypb.RepositoryService_GetInfoAttributesServer) error { diff --git a/internal/service/repository/info_attributes_test.go b/internal/service/repository/info_attributes_test.go index 4f55fc87f..bd30798c1 100644 --- a/internal/service/repository/info_attributes_test.go +++ b/internal/service/repository/info_attributes_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" diff --git a/internal/service/repository/license.go b/internal/service/repository/license.go index 584cdba6b..9997d4e64 100644 --- a/internal/service/repository/license.go +++ b/internal/service/repository/license.go @@ -1,9 +1,10 @@ package repository import ( + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" ) func (s *server) FindLicense(ctx context.Context, in *gitalypb.FindLicenseRequest) (*gitalypb.FindLicenseResponse, error) { diff --git a/internal/service/repository/license_test.go b/internal/service/repository/license_test.go index 71f071de0..31a37e911 100644 --- a/internal/service/repository/license_test.go +++ b/internal/service/repository/license_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" diff --git a/internal/service/repository/merge_base.go b/internal/service/repository/merge_base.go index 192a00c7c..523d06a52 100644 --- a/internal/service/repository/merge_base.go +++ b/internal/service/repository/merge_base.go @@ -4,11 +4,12 @@ import ( "io/ioutil" "strings" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" ) func (s *server) FindMergeBase(ctx context.Context, req *gitalypb.FindMergeBaseRequest) (*gitalypb.FindMergeBaseResponse, error) { diff --git a/internal/service/repository/merge_base_test.go b/internal/service/repository/merge_base_test.go index 8e99e9310..df188724d 100644 --- a/internal/service/repository/merge_base_test.go +++ b/internal/service/repository/merge_base_test.go @@ -4,9 +4,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulFindFindMergeBaseRequest(t *testing.T) { diff --git a/internal/service/repository/raw_changes.go b/internal/service/repository/raw_changes.go index 29fdc1743..94a346189 100644 --- a/internal/service/repository/raw_changes.go +++ b/internal/service/repository/raw_changes.go @@ -1,10 +1,11 @@ package repository import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) GetRawChanges(req *gitalypb.GetRawChangesRequest, stream gitalypb.RepositoryService_GetRawChangesServer) error { diff --git a/internal/service/repository/raw_changes_test.go b/internal/service/repository/raw_changes_test.go index 5d1af5d86..4ab8c82f4 100644 --- a/internal/service/repository/raw_changes_test.go +++ b/internal/service/repository/raw_changes_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestGetRawChanges(t *testing.T) { diff --git a/internal/service/repository/rebase_in_progress.go b/internal/service/repository/rebase_in_progress.go index 2fff4d7f6..2f81e91a8 100644 --- a/internal/service/repository/rebase_in_progress.go +++ b/internal/service/repository/rebase_in_progress.go @@ -7,12 +7,13 @@ import ( "strings" "time" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/helper" - "gitlab.com/gitlab-org/gitaly/internal/helper/housekeeping" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/helper" + "gitlab.com/gitlab-org/gitaly/internal/helper/housekeeping" ) const ( diff --git a/internal/service/repository/rebase_in_progress_test.go b/internal/service/repository/rebase_in_progress_test.go index 44d1bbe61..25cc0ed2e 100644 --- a/internal/service/repository/rebase_in_progress_test.go +++ b/internal/service/repository/rebase_in_progress_test.go @@ -8,9 +8,10 @@ import ( "time" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulIsRebaseInProgressRequest(t *testing.T) { diff --git a/internal/service/repository/repack.go b/internal/service/repository/repack.go index 3f031c0be..9a5fca46f 100644 --- a/internal/service/repository/repack.go +++ b/internal/service/repository/repack.go @@ -3,11 +3,12 @@ package repository import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" ) func (server) RepackFull(ctx context.Context, in *gitalypb.RepackFullRequest) (*gitalypb.RepackFullResponse, error) { diff --git a/internal/service/repository/repack_test.go b/internal/service/repository/repack_test.go index b825aa6e6..ce13dafe1 100644 --- a/internal/service/repository/repack_test.go +++ b/internal/service/repository/repack_test.go @@ -8,9 +8,10 @@ import ( "time" "github.com/stretchr/testify/assert" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestRepackIncrementalSuccess(t *testing.T) { diff --git a/internal/service/repository/repository.go b/internal/service/repository/repository.go index 2fb780f5d..38ac363e2 100644 --- a/internal/service/repository/repository.go +++ b/internal/service/repository/repository.go @@ -3,12 +3,13 @@ package repository import ( "io/ioutil" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" - "gitlab.com/gitlab-org/gitaly/internal/helper" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/helper" ) // Deprecated diff --git a/internal/service/repository/repository_test.go b/internal/service/repository/repository_test.go index 7d4998299..f504089d2 100644 --- a/internal/service/repository/repository_test.go +++ b/internal/service/repository/repository_test.go @@ -7,12 +7,13 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestRepositoryExists(t *testing.T) { diff --git a/internal/service/repository/restore_custom_hooks.go b/internal/service/repository/restore_custom_hooks.go index d68a2df3b..4ae2b5cd4 100644 --- a/internal/service/repository/restore_custom_hooks.go +++ b/internal/service/repository/restore_custom_hooks.go @@ -3,12 +3,13 @@ package repository import ( "os/exec" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) RestoreCustomHooks(stream gitalypb.RepositoryService_RestoreCustomHooksServer) error { diff --git a/internal/service/repository/restore_custom_hooks_test.go b/internal/service/repository/restore_custom_hooks_test.go index 7b91c99b3..5a0fd0b96 100644 --- a/internal/service/repository/restore_custom_hooks_test.go +++ b/internal/service/repository/restore_custom_hooks_test.go @@ -7,11 +7,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" ) func TestSuccessfullRestoreCustomHooksRequest(t *testing.T) { diff --git a/internal/service/repository/search_files.go b/internal/service/repository/search_files.go index d48b2bb0e..def8fa702 100644 --- a/internal/service/repository/search_files.go +++ b/internal/service/repository/search_files.go @@ -4,12 +4,13 @@ import ( "bytes" "errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/helper/lines" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) const surroundContext = "2" diff --git a/internal/service/repository/search_files_test.go b/internal/service/repository/search_files_test.go index ac3448935..5b8d05393 100644 --- a/internal/service/repository/search_files_test.go +++ b/internal/service/repository/search_files_test.go @@ -6,9 +6,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) var ( diff --git a/internal/service/repository/size.go b/internal/service/repository/size.go index e8c55c0b8..dff5c185d 100644 --- a/internal/service/repository/size.go +++ b/internal/service/repository/size.go @@ -8,10 +8,11 @@ import ( "strconv" "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/helper" - "golang.org/x/net/context" ) func (s *server) RepositorySize(ctx context.Context, in *gitalypb.RepositorySizeRequest) (*gitalypb.RepositorySizeResponse, error) { diff --git a/internal/service/repository/size_test.go b/internal/service/repository/size_test.go index 6dc9a37b3..6cf3ab8be 100644 --- a/internal/service/repository/size_test.go +++ b/internal/service/repository/size_test.go @@ -6,11 +6,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulRepositorySizeRequest(t *testing.T) { diff --git a/internal/service/repository/snapshot.go b/internal/service/repository/snapshot.go index 9c829b402..7197efee7 100644 --- a/internal/service/repository/snapshot.go +++ b/internal/service/repository/snapshot.go @@ -3,12 +3,13 @@ package repository import ( "regexp" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/archive" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var objectFiles = []*regexp.Regexp{ diff --git a/internal/service/repository/snapshot_test.go b/internal/service/repository/snapshot_test.go index d60516a0b..16c41331d 100644 --- a/internal/service/repository/snapshot_test.go +++ b/internal/service/repository/snapshot_test.go @@ -11,11 +11,12 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/archive" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" ) func getSnapshot(t *testing.T, req *gitalypb.GetSnapshotRequest) ([]byte, error) { diff --git a/internal/service/repository/squash_in_progress.go b/internal/service/repository/squash_in_progress.go index 81b6441fd..47ca399d6 100644 --- a/internal/service/repository/squash_in_progress.go +++ b/internal/service/repository/squash_in_progress.go @@ -4,11 +4,12 @@ import ( "fmt" "strings" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/helper" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/helper" ) const ( diff --git a/internal/service/repository/squash_in_progress_test.go b/internal/service/repository/squash_in_progress_test.go index 2e262130c..11a885545 100644 --- a/internal/service/repository/squash_in_progress_test.go +++ b/internal/service/repository/squash_in_progress_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulIsSquashInProgressRequest(t *testing.T) { diff --git a/internal/service/repository/testhelper_test.go b/internal/service/repository/testhelper_test.go index 20a8b6ef5..941a19a61 100644 --- a/internal/service/repository/testhelper_test.go +++ b/internal/service/repository/testhelper_test.go @@ -9,14 +9,15 @@ import ( "time" "github.com/stretchr/testify/assert" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" gitalyauth "gitlab.com/gitlab-org/gitaly/auth" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/server/auth" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) // Stamp taken from https://golang.org/pkg/time/#pkg-constants diff --git a/internal/service/repository/util.go b/internal/service/repository/util.go index f859358fc..4a2078767 100644 --- a/internal/service/repository/util.go +++ b/internal/service/repository/util.go @@ -3,9 +3,10 @@ package repository import ( "fmt" + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" - "golang.org/x/net/context" ) func removeOriginInRepo(ctx context.Context, repository *gitalypb.Repository) error { diff --git a/internal/service/repository/write_config.go b/internal/service/repository/write_config.go index 0a6b3d279..0e89e0949 100644 --- a/internal/service/repository/write_config.go +++ b/internal/service/repository/write_config.go @@ -1,9 +1,10 @@ package repository import ( + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" - "golang.org/x/net/context" ) func (s *server) WriteConfig(ctx context.Context, req *gitalypb.WriteConfigRequest) (*gitalypb.WriteConfigResponse, error) { diff --git a/internal/service/repository/write_config_test.go b/internal/service/repository/write_config_test.go index 135025b50..273785b42 100644 --- a/internal/service/repository/write_config_test.go +++ b/internal/service/repository/write_config_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestWriteConfigSuccessful(t *testing.T) { diff --git a/internal/service/repository/write_ref.go b/internal/service/repository/write_ref.go index a70c15490..6298840a3 100644 --- a/internal/service/repository/write_ref.go +++ b/internal/service/repository/write_ref.go @@ -4,12 +4,13 @@ import ( "bytes" "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/git" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) WriteRef(ctx context.Context, req *gitalypb.WriteRefRequest) (*gitalypb.WriteRefResponse, error) { diff --git a/internal/service/repository/write_ref_test.go b/internal/service/repository/write_ref_test.go index b8b8601a5..fd34f8f1e 100644 --- a/internal/service/repository/write_ref_test.go +++ b/internal/service/repository/write_ref_test.go @@ -6,9 +6,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestWriteRefSuccessful(t *testing.T) { diff --git a/internal/service/server/info.go b/internal/service/server/info.go index 323014ab3..f21b370db 100644 --- a/internal/service/server/info.go +++ b/internal/service/server/info.go @@ -5,11 +5,12 @@ import ( "os" "path" + "golang.org/x/net/context" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/version" - "golang.org/x/net/context" ) func (s *server) ServerInfo(ctx context.Context, in *gitalypb.ServerInfoRequest) (*gitalypb.ServerInfoResponse, error) { diff --git a/internal/service/server/info_test.go b/internal/service/server/info_test.go index 5f10b0774..31cb759c1 100644 --- a/internal/service/server/info_test.go +++ b/internal/service/server/info_test.go @@ -6,6 +6,9 @@ import ( "time" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" gitalyauth "gitlab.com/gitlab-org/gitaly/auth" "gitlab.com/gitlab-org/gitaly/internal/config" @@ -13,8 +16,6 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/server/auth" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/internal/version" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) func TestGitalyServerInfo(t *testing.T) { diff --git a/internal/service/smarthttp/inforefs.go b/internal/service/smarthttp/inforefs.go index 1992ac040..72e0346b6 100644 --- a/internal/service/smarthttp/inforefs.go +++ b/internal/service/smarthttp/inforefs.go @@ -7,13 +7,14 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/pktline" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) InfoRefsUploadPack(in *gitalypb.InfoRefsRequest, stream gitalypb.SmartHTTPService_InfoRefsUploadPackServer) error { diff --git a/internal/service/smarthttp/inforefs_test.go b/internal/service/smarthttp/inforefs_test.go index e2ed888d4..ad92f0d49 100644 --- a/internal/service/smarthttp/inforefs_test.go +++ b/internal/service/smarthttp/inforefs_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulInfoRefsUploadPack(t *testing.T) { diff --git a/internal/service/smarthttp/receive_pack.go b/internal/service/smarthttp/receive_pack.go index 040193aaf..de71b8330 100644 --- a/internal/service/smarthttp/receive_pack.go +++ b/internal/service/smarthttp/receive_pack.go @@ -5,13 +5,14 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) PostReceivePack(stream gitalypb.SmartHTTPService_PostReceivePackServer) error { diff --git a/internal/service/smarthttp/receive_pack_test.go b/internal/service/smarthttp/receive_pack_test.go index dc6ffbbf5..ffd99f728 100644 --- a/internal/service/smarthttp/receive_pack_test.go +++ b/internal/service/smarthttp/receive_pack_test.go @@ -11,13 +11,14 @@ import ( "time" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestSuccessfulReceivePackRequest(t *testing.T) { diff --git a/internal/service/smarthttp/testhelper_test.go b/internal/service/smarthttp/testhelper_test.go index ee2642b2e..678d3e1e7 100644 --- a/internal/service/smarthttp/testhelper_test.go +++ b/internal/service/smarthttp/testhelper_test.go @@ -5,10 +5,11 @@ import ( "testing" "time" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc" "google.golang.org/grpc/reflection" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) const ( diff --git a/internal/service/smarthttp/upload_pack.go b/internal/service/smarthttp/upload_pack.go index 60872fcbd..a8a583f87 100644 --- a/internal/service/smarthttp/upload_pack.go +++ b/internal/service/smarthttp/upload_pack.go @@ -4,13 +4,14 @@ import ( "io" "github.com/prometheus/client_golang/prometheus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) var ( diff --git a/internal/service/smarthttp/upload_pack_test.go b/internal/service/smarthttp/upload_pack_test.go index 3c44fcd45..83bac8cef 100644 --- a/internal/service/smarthttp/upload_pack_test.go +++ b/internal/service/smarthttp/upload_pack_test.go @@ -13,6 +13,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/git" @@ -20,8 +23,6 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) const ( diff --git a/internal/service/ssh/receive_pack.go b/internal/service/ssh/receive_pack.go index 84decfe9c..71405623a 100644 --- a/internal/service/ssh/receive_pack.go +++ b/internal/service/ssh/receive_pack.go @@ -5,13 +5,14 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) SSHReceivePack(stream gitalypb.SSHService_SSHReceivePackServer) error { diff --git a/internal/service/ssh/receive_pack_test.go b/internal/service/ssh/receive_pack_test.go index 37531c853..524bed782 100644 --- a/internal/service/ssh/receive_pack_test.go +++ b/internal/service/ssh/receive_pack_test.go @@ -12,12 +12,13 @@ import ( "github.com/golang/protobuf/jsonpb" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestFailedReceivePackRequestDueToValidationError(t *testing.T) { diff --git a/internal/service/ssh/testhelper_test.go b/internal/service/ssh/testhelper_test.go index 68ced139c..e61ee306c 100644 --- a/internal/service/ssh/testhelper_test.go +++ b/internal/service/ssh/testhelper_test.go @@ -8,10 +8,11 @@ import ( "time" log "github.com/sirupsen/logrus" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc" "google.golang.org/grpc/reflection" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) const ( diff --git a/internal/service/ssh/upload_archive.go b/internal/service/ssh/upload_archive.go index c29ebf07b..fce759d7f 100644 --- a/internal/service/ssh/upload_archive.go +++ b/internal/service/ssh/upload_archive.go @@ -1,13 +1,14 @@ package ssh import ( + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) SSHUploadArchive(stream gitalypb.SSHService_SSHUploadArchiveServer) error { diff --git a/internal/service/ssh/upload_archive_test.go b/internal/service/ssh/upload_archive_test.go index c639c003b..bf71445db 100644 --- a/internal/service/ssh/upload_archive_test.go +++ b/internal/service/ssh/upload_archive_test.go @@ -8,10 +8,11 @@ import ( "github.com/golang/protobuf/jsonpb" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" "golang.org/x/net/context" "google.golang.org/grpc/codes" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) func TestFailedUploadArchiveRequestDueToValidationError(t *testing.T) { diff --git a/internal/service/ssh/upload_pack.go b/internal/service/ssh/upload_pack.go index add35b0b3..7c39b47bf 100644 --- a/internal/service/ssh/upload_pack.go +++ b/internal/service/ssh/upload_pack.go @@ -1,13 +1,14 @@ package ssh import ( + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/command" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/streamio" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func (s *server) SSHUploadPack(stream gitalypb.SSHService_SSHUploadPackServer) error { diff --git a/internal/service/ssh/upload_pack_test.go b/internal/service/ssh/upload_pack_test.go index d62734e2f..87d1a03d9 100644 --- a/internal/service/ssh/upload_pack_test.go +++ b/internal/service/ssh/upload_pack_test.go @@ -11,12 +11,13 @@ import ( "github.com/golang/protobuf/jsonpb" "github.com/stretchr/testify/require" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "golang.org/x/net/context" - "google.golang.org/grpc/codes" ) func TestFailedUploadPackRequestDueToValidationError(t *testing.T) { diff --git a/internal/service/storage/deleteall.go b/internal/service/storage/deleteall.go index 25c53c73d..e530e591f 100644 --- a/internal/service/storage/deleteall.go +++ b/internal/service/storage/deleteall.go @@ -7,12 +7,13 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/helper" - "gitlab.com/gitlab-org/gitaly/internal/tempdir" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/helper" + "gitlab.com/gitlab-org/gitaly/internal/tempdir" ) func (s *server) DeleteAllRepositories(ctx context.Context, req *gitalypb.DeleteAllRepositoriesRequest) (*gitalypb.DeleteAllRepositoriesResponse, error) { diff --git a/internal/service/storage/deleteall_test.go b/internal/service/storage/deleteall_test.go index d8b8b3ccb..03dbbaf0d 100644 --- a/internal/service/storage/deleteall_test.go +++ b/internal/service/storage/deleteall_test.go @@ -9,12 +9,13 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/tempdir" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) func TestDeleteAllSuccess(t *testing.T) { diff --git a/internal/service/storage/listdirectories.go b/internal/service/storage/listdirectories.go index 43b85fcb5..aea65d2c7 100644 --- a/internal/service/storage/listdirectories.go +++ b/internal/service/storage/listdirectories.go @@ -5,10 +5,11 @@ import ( "path/filepath" "strings" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/helper" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/helper" ) func (s *server) ListDirectories(req *gitalypb.ListDirectoriesRequest, stream gitalypb.StorageService_ListDirectoriesServer) error { diff --git a/internal/service/storage/listdirectories_test.go b/internal/service/storage/listdirectories_test.go index 4e827e988..beb64c47d 100644 --- a/internal/service/storage/listdirectories_test.go +++ b/internal/service/storage/listdirectories_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/testhelper" diff --git a/internal/service/storage/testhelper_test.go b/internal/service/storage/testhelper_test.go index aeb405ca6..6890e8981 100644 --- a/internal/service/storage/testhelper_test.go +++ b/internal/service/storage/testhelper_test.go @@ -7,11 +7,12 @@ import ( "testing" "time" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) var testStorage config.Storage diff --git a/internal/service/wiki/delete_page.go b/internal/service/wiki/delete_page.go index cd1ecbaff..449e319f2 100644 --- a/internal/service/wiki/delete_page.go +++ b/internal/service/wiki/delete_page.go @@ -3,11 +3,12 @@ package wiki import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) WikiDeletePage(ctx context.Context, request *gitalypb.WikiDeletePageRequest) (*gitalypb.WikiDeletePageResponse, error) { diff --git a/internal/service/wiki/delete_page_test.go b/internal/service/wiki/delete_page_test.go index 85e8879bb..c9fbb4543 100644 --- a/internal/service/wiki/delete_page_test.go +++ b/internal/service/wiki/delete_page_test.go @@ -4,10 +4,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulWikiDeletePageRequest(t *testing.T) { diff --git a/internal/service/wiki/find_file.go b/internal/service/wiki/find_file.go index c05598c92..87f9a5e16 100644 --- a/internal/service/wiki/find_file.go +++ b/internal/service/wiki/find_file.go @@ -1,10 +1,11 @@ package wiki import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) WikiFindFile(request *gitalypb.WikiFindFileRequest, stream gitalypb.WikiService_WikiFindFileServer) error { diff --git a/internal/service/wiki/find_file_test.go b/internal/service/wiki/find_file_test.go index 72dd58676..df619055d 100644 --- a/internal/service/wiki/find_file_test.go +++ b/internal/service/wiki/find_file_test.go @@ -9,9 +9,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulWikiFindFileRequest(t *testing.T) { diff --git a/internal/service/wiki/find_page.go b/internal/service/wiki/find_page.go index 290e92ce5..6d5d32b2f 100644 --- a/internal/service/wiki/find_page.go +++ b/internal/service/wiki/find_page.go @@ -1,10 +1,11 @@ package wiki import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) WikiFindPage(request *gitalypb.WikiFindPageRequest, stream gitalypb.WikiService_WikiFindPageServer) error { diff --git a/internal/service/wiki/find_page_test.go b/internal/service/wiki/find_page_test.go index e0c23cbb4..6535b7fca 100644 --- a/internal/service/wiki/find_page_test.go +++ b/internal/service/wiki/find_page_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulWikiFindPageRequest(t *testing.T) { diff --git a/internal/service/wiki/formatted_data.go b/internal/service/wiki/formatted_data.go index 12b2f11f6..97e635fe4 100644 --- a/internal/service/wiki/formatted_data.go +++ b/internal/service/wiki/formatted_data.go @@ -1,10 +1,11 @@ package wiki import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) WikiGetFormattedData(request *gitalypb.WikiGetFormattedDataRequest, stream gitalypb.WikiService_WikiGetFormattedDataServer) error { diff --git a/internal/service/wiki/formatted_data_test.go b/internal/service/wiki/formatted_data_test.go index 2047fe261..7f17c115f 100644 --- a/internal/service/wiki/formatted_data_test.go +++ b/internal/service/wiki/formatted_data_test.go @@ -6,9 +6,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulWikiGetFormattedDataRequest(t *testing.T) { diff --git a/internal/service/wiki/get_all_pages_test.go b/internal/service/wiki/get_all_pages_test.go index 5162b530c..8cfe57fa1 100644 --- a/internal/service/wiki/get_all_pages_test.go +++ b/internal/service/wiki/get_all_pages_test.go @@ -5,9 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulWikiGetAllPagesRequest(t *testing.T) { diff --git a/internal/service/wiki/get_page_versions.go b/internal/service/wiki/get_page_versions.go index 2925c6f07..6f0d710f9 100644 --- a/internal/service/wiki/get_page_versions.go +++ b/internal/service/wiki/get_page_versions.go @@ -1,10 +1,11 @@ package wiki import ( - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) WikiGetPageVersions(request *gitalypb.WikiGetPageVersionsRequest, stream gitalypb.WikiService_WikiGetPageVersionsServer) error { diff --git a/internal/service/wiki/get_page_versions_test.go b/internal/service/wiki/get_page_versions_test.go index aafdf6e69..41467959a 100644 --- a/internal/service/wiki/get_page_versions_test.go +++ b/internal/service/wiki/get_page_versions_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/service/wiki/testhelper_test.go b/internal/service/wiki/testhelper_test.go index c67da5609..309adff40 100644 --- a/internal/service/wiki/testhelper_test.go +++ b/internal/service/wiki/testhelper_test.go @@ -11,13 +11,14 @@ import ( log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" ) type createWikiPageOpts struct { diff --git a/internal/service/wiki/update_page.go b/internal/service/wiki/update_page.go index 5c665a1bb..15dbde866 100644 --- a/internal/service/wiki/update_page.go +++ b/internal/service/wiki/update_page.go @@ -3,10 +3,11 @@ package wiki import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) WikiUpdatePage(stream gitalypb.WikiService_WikiUpdatePageServer) error { diff --git a/internal/service/wiki/update_page_test.go b/internal/service/wiki/update_page_test.go index 696b7d84e..f65274fb5 100644 --- a/internal/service/wiki/update_page_test.go +++ b/internal/service/wiki/update_page_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulWikiUpdatePageRequest(t *testing.T) { diff --git a/internal/service/wiki/write_page.go b/internal/service/wiki/write_page.go index 635fd8033..020fdebc6 100644 --- a/internal/service/wiki/write_page.go +++ b/internal/service/wiki/write_page.go @@ -3,10 +3,11 @@ package wiki import ( "fmt" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/rubyserver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" ) func (s *server) WikiWritePage(stream gitalypb.WikiService_WikiWritePageServer) error { diff --git a/internal/service/wiki/write_page_test.go b/internal/service/wiki/write_page_test.go index 04620d612..284f2fce8 100644 --- a/internal/service/wiki/write_page_test.go +++ b/internal/service/wiki/write_page_test.go @@ -5,10 +5,11 @@ import ( "testing" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log" "gitlab.com/gitlab-org/gitaly/internal/testhelper" - "google.golang.org/grpc/codes" ) func TestSuccessfulWikiWritePageRequest(t *testing.T) { diff --git a/internal/supervisor/supervisor_test.go b/internal/supervisor/supervisor_test.go index c56e5fb3e..5c33062ac 100644 --- a/internal/supervisor/supervisor_test.go +++ b/internal/supervisor/supervisor_test.go @@ -15,6 +15,7 @@ import ( "time" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly/internal/testhelper" ) diff --git a/internal/tempdir/tempdir.go b/internal/tempdir/tempdir.go index faa0bc0b0..d3dd69162 100644 --- a/internal/tempdir/tempdir.go +++ b/internal/tempdir/tempdir.go @@ -10,6 +10,7 @@ import ( "time" log "github.com/sirupsen/logrus" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/helper" diff --git a/internal/tempdir/tempdir_test.go b/internal/tempdir/tempdir_test.go index ef09b7e25..d98daafd2 100644 --- a/internal/tempdir/tempdir_test.go +++ b/internal/tempdir/tempdir_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper" diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go index 1d470c61a..061363b1d 100644 --- a/internal/testhelper/testhelper.go +++ b/internal/testhelper/testhelper.go @@ -23,14 +23,15 @@ import ( log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" - "gitlab.com/gitlab-org/gitaly/internal/command" - "gitlab.com/gitlab-org/gitaly/internal/config" - "gitlab.com/gitlab-org/gitaly/internal/storage" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + + "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" + "gitlab.com/gitlab-org/gitaly/internal/command" + "gitlab.com/gitlab-org/gitaly/internal/config" + "gitlab.com/gitlab-org/gitaly/internal/storage" ) // TestRelativePath is the path inside its storage of the gitlab-test repo |