From 34d5b49968eeae248720a21249ec1e212f300614 Mon Sep 17 00:00:00 2001 From: David May <49894298+wass3rw3rk@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:51:30 -0500 Subject: [PATCH] chore: import order (#572) --- .golangci.yml | 94 +++++++++++++++----------- Makefile | 21 ++++++ api/build.go | 4 +- api/pipeline.go | 4 +- api/register.go | 3 +- api/repo.go | 4 +- cmd/vela-worker/client.go | 4 +- cmd/vela-worker/flags.go | 4 +- cmd/vela-worker/main.go | 5 +- cmd/vela-worker/server.go | 4 +- executor/context_test.go | 5 +- executor/executor.go | 4 +- executor/executor_test.go | 12 ++-- executor/flags.go | 4 +- executor/linux/build_test.go | 8 +-- executor/linux/driver_test.go | 1 + executor/linux/linux.go | 3 +- executor/linux/linux_test.go | 2 +- executor/linux/opts.go | 3 +- executor/linux/opts_test.go | 3 +- executor/linux/secret.go | 4 +- executor/linux/secret_test.go | 5 +- executor/linux/service_test.go | 1 + executor/linux/stage_test.go | 3 +- executor/linux/step_test.go | 1 + executor/local/build.go | 2 +- executor/local/local_test.go | 7 +- executor/local/opts.go | 8 +-- executor/local/opts_test.go | 9 +-- executor/local/service.go | 5 +- executor/local/service_test.go | 5 +- executor/local/stage.go | 3 +- executor/local/stage_test.go | 4 +- executor/local/step_test.go | 5 +- executor/setup.go | 13 ++-- executor/setup_test.go | 8 +-- internal/build/snapshot.go | 3 +- internal/build/snapshot_test.go | 1 + internal/build/upload.go | 3 +- internal/build/upload_test.go | 1 + internal/service/snapshot.go | 3 +- internal/service/snapshot_test.go | 1 + internal/service/upload.go | 3 +- internal/service/upload_test.go | 1 + internal/step/snapshot.go | 3 +- internal/step/snapshot_test.go | 1 + internal/step/upload.go | 3 +- internal/step/upload_test.go | 1 + mock/worker/build.go | 1 + mock/worker/executor.go | 1 + mock/worker/pipeline.go | 4 +- mock/worker/repo.go | 1 + router/executor.go | 1 + router/middleware/executor/executor.go | 3 +- router/middleware/header.go | 1 + router/middleware/logger_test.go | 1 - router/middleware/perm/perm.go | 6 +- router/router.go | 1 + runtime/docker/container.go | 3 +- runtime/docker/docker.go | 3 +- runtime/docker/docker_test.go | 4 +- runtime/docker/image.go | 2 +- runtime/docker/volume.go | 3 +- runtime/flags.go | 4 +- runtime/kubernetes/build.go | 7 +- runtime/kubernetes/build_test.go | 6 +- runtime/kubernetes/container.go | 8 +-- runtime/kubernetes/container_test.go | 6 +- runtime/kubernetes/kubernetes.go | 2 +- runtime/kubernetes/kubernetes_test.go | 4 +- runtime/kubernetes/mock.go | 2 +- runtime/kubernetes/opts.go | 1 - runtime/kubernetes/pod_tracker.go | 1 - runtime/kubernetes/pod_tracker_test.go | 1 - runtime/kubernetes/volume_test.go | 4 +- runtime/runtime.go | 3 +- runtime/setup.go | 10 ++- version/version.go | 3 +- 78 files changed, 211 insertions(+), 185 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 44382f6f..a65dfc2b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -32,6 +32,18 @@ linters-settings: lines: 160 statements: 70 + # https://github.com/daixiang0/gci + # ensure import order is consistent + # gci write --custom-order -s standard -s default -s blank -s dot -s "prefix(github.com/go-vela)" . + gci: + custom-order: true + sections: + - standard + - default + - blank + - dot + - prefix(github.com/go-vela) + # https://github.com/denis-tingaikin/go-header goheader: template: |- @@ -57,46 +69,46 @@ linters: # enable a specific set of linters to run enable: - - bidichk # checks for dangerous unicode character sequences - - bodyclose # checks whether HTTP response body is closed successfully - - contextcheck # check the function whether use a non-inherited context - - deadcode # finds unused code - - dupl # code clone detection - - errcheck # checks for unchecked errors - - errorlint # find misuses of errors - - exportloopref # check for exported loop vars - - funlen # detects long functions - - goconst # finds repeated strings that could be replaced by a constant - - gocyclo # computes and checks the cyclomatic complexity of functions - - godot # checks if comments end in a period - - gofmt # checks whether code was gofmt-ed - - goheader # checks is file header matches to pattern - - goimports # fixes imports and formats code in same style as gofmt - - gomoddirectives # manage the use of 'replace', 'retract', and 'excludes' directives in go.mod - - goprintffuncname # checks that printf-like functions are named with f at the end - - gosec # inspects code for security problems - - gosimple # linter that specializes in simplifying a code - - govet # reports suspicious constructs, ex. Printf calls whose arguments don't align with the format string - - ineffassign # detects when assignments to existing variables aren't used - - makezero # finds slice declarations with non-zero initial length - - misspell # finds commonly misspelled English words in comments - - nakedret # finds naked returns in functions greater than a specified function length - - nilerr # finds the code that returns nil even if it checks that the error is not nil - - noctx # noctx finds sending http request without context.Context - - nolintlint # reports ill-formed or insufficient nolint directives - - revive # linter for go - - staticcheck # applies static analysis checks, go vet on steroids - - structcheck # finds unused struct fields - - stylecheck # replacement for golint - - tenv # analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 - - typecheck # parses and type-checks go code, like the front-end of a go compiler - - unconvert # remove unnecessary type conversions - - unparam # reports unused function parameters - - unused # checks for unused constants, variables, functions and types - - varcheck # finds unused global variables and constants - - whitespace # detects leading and trailing whitespace - - wsl # forces code to use empty lines - + - bidichk # checks for dangerous unicode character sequences + - bodyclose # checks whether HTTP response body is closed successfully + - contextcheck # check the function whether use a non-inherited context + - deadcode # finds unused code + - dupl # code clone detection + - errcheck # checks for unchecked errors + - errorlint # find misuses of errors + - exportloopref # check for exported loop vars + - funlen # detects long functions + - gci # consistent import ordering + - goconst # finds repeated strings that could be replaced by a constant + - gocyclo # computes and checks the cyclomatic complexity of functions + - godot # checks if comments end in a period + - gofmt # checks whether code was gofmt-ed + - goheader # checks is file header matches to pattern + - gomoddirectives # manage the use of 'replace', 'retract', and 'excludes' directives in go.mod + - goprintffuncname # checks that printf-like functions are named with f at the end + - gosec # inspects code for security problems + - gosimple # linter that specializes in simplifying a code + - govet # reports suspicious constructs, ex. Printf calls whose arguments don't align with the format string + - ineffassign # detects when assignments to existing variables aren't used + - makezero # finds slice declarations with non-zero initial length + - misspell # finds commonly misspelled English words in comments + - nakedret # finds naked returns in functions greater than a specified function length + - nilerr # finds the code that returns nil even if it checks that the error is not nil + - noctx # noctx finds sending http request without context.Context + - nolintlint # reports ill-formed or insufficient nolint directives + - revive # linter for go + - staticcheck # applies static analysis checks, go vet on steroids + - structcheck # finds unused struct fields + - stylecheck # replacement for golint + - tenv # analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 + - typecheck # parses and type-checks go code, like the front-end of a go compiler + - unconvert # remove unnecessary type conversions + - unparam # reports unused function parameters + - unused # checks for unused constants, variables, functions and types + - varcheck # finds unused global variables and constants + - whitespace # detects leading and trailing whitespace + - wsl # forces code to use empty lines + # static list of linters we know golangci can run but we've # chosen to leave disabled for now # - asciicheck - non-critical @@ -109,13 +121,13 @@ linters: # - exhaustivestruct - style preference # - forbidigo - unused # - forcetypeassert - unused - # - gci - use goimports # - gochecknoinits - unused # - gochecknoglobals - global variables allowed # - gocognit - unused complexity metric # - gocritic - style preference # - godox - to be used in the future # - goerr113 - to be used in the future + # - goimports - use gci # - golint - archived, replaced with revive # - gofumpt - use gofmt # - gomnd - get too many false-positives diff --git a/Makefile b/Makefile index 2c4adfdd..c8457eb7 100644 --- a/Makefile +++ b/Makefile @@ -318,6 +318,27 @@ spec-version-update: .PHONY: spec spec: spec-gen spec-version-update spec-validate +# The `lint` target is intended to lint the +# Go source code with golangci-lint. +# +# Usage: `make lint` +.PHONY: lint +lint: + @echo + @echo "### Linting Go Code" + @golangci-lint run ./... + +# The `lintfix` target is intended to lint the +# Go source code with golangci-lint and apply +# any fixes that can be automatically applied. +# +# Usage: `make lintfix` +.PHONY: lintfix +lintfix: + @echo + @echo "### Fixing Go code with linter" + @golangci-lint run ./... --fix + # The `crd-gen` target is intended to create a k8s CRD client # for the kubernetes runtime using k8s.io/code-generator # diff --git a/api/build.go b/api/build.go index ab15b247..173dd733 100644 --- a/api/build.go +++ b/api/build.go @@ -6,9 +6,9 @@ import ( "fmt" "net/http" - "github.com/go-vela/types" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types" "github.com/go-vela/worker/router/middleware/executor" ) diff --git a/api/pipeline.go b/api/pipeline.go index 7087986a..f1ec05ab 100644 --- a/api/pipeline.go +++ b/api/pipeline.go @@ -6,9 +6,9 @@ import ( "fmt" "net/http" - "github.com/go-vela/types" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types" "github.com/go-vela/worker/router/middleware/executor" ) diff --git a/api/register.go b/api/register.go index c530d28c..887e35b0 100644 --- a/api/register.go +++ b/api/register.go @@ -7,8 +7,9 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/go-vela/worker/router/middleware/token" "github.com/golang-jwt/jwt/v5" + + "github.com/go-vela/worker/router/middleware/token" ) // swagger:operation POST /register system Register diff --git a/api/repo.go b/api/repo.go index 16544827..a1ee9283 100644 --- a/api/repo.go +++ b/api/repo.go @@ -6,9 +6,9 @@ import ( "fmt" "net/http" - "github.com/go-vela/types" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types" "github.com/go-vela/worker/router/middleware/executor" ) diff --git a/cmd/vela-worker/client.go b/cmd/vela-worker/client.go index add1fd69..452a1550 100644 --- a/cmd/vela-worker/client.go +++ b/cmd/vela-worker/client.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/sdk-go/vela" - "github.com/sirupsen/logrus" + + "github.com/go-vela/sdk-go/vela" ) // helper function to setup the queue from the CLI arguments. diff --git a/cmd/vela-worker/flags.go b/cmd/vela-worker/flags.go index b6b91f91..4586ea62 100644 --- a/cmd/vela-worker/flags.go +++ b/cmd/vela-worker/flags.go @@ -5,11 +5,11 @@ package main import ( "time" + "github.com/urfave/cli/v2" + "github.com/go-vela/server/queue" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" - - "github.com/urfave/cli/v2" ) // flags is a helper function to return the all diff --git a/cmd/vela-worker/main.go b/cmd/vela-worker/main.go index 53d4f67d..020fecc5 100644 --- a/cmd/vela-worker/main.go +++ b/cmd/vela-worker/main.go @@ -8,13 +8,12 @@ import ( "os" "time" - "github.com/go-vela/worker/version" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" _ "github.com/joho/godotenv/autoload" + + "github.com/go-vela/worker/version" ) // hostname stores the worker host name reported by the kernel. diff --git a/cmd/vela-worker/server.go b/cmd/vela-worker/server.go index ff8ed213..54fc292a 100644 --- a/cmd/vela-worker/server.go +++ b/cmd/vela-worker/server.go @@ -9,10 +9,10 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/worker/router" "github.com/go-vela/worker/router/middleware" - - "github.com/sirupsen/logrus" ) // server is a helper function to listen and serve diff --git a/executor/context_test.go b/executor/context_test.go index e2286c70..e39efc43 100644 --- a/executor/context_test.go +++ b/executor/context_test.go @@ -10,13 +10,10 @@ import ( "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/mock/server" - "github.com/go-vela/worker/executor/linux" - "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" ) func TestExecutor_FromContext(t *testing.T) { diff --git a/executor/executor.go b/executor/executor.go index 20b09ef8..c166a40a 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -5,9 +5,9 @@ package executor import ( "fmt" - "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // New creates and returns a Vela engine capable of diff --git a/executor/executor_test.go b/executor/executor_test.go index 4ead7490..1fc9c643 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -10,20 +10,16 @@ import ( "github.com/gin-gonic/gin" "github.com/google/go-cmp/cmp" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/api/types/actions" "github.com/go-vela/server/mock/server" - - "github.com/go-vela/worker/executor/linux" - "github.com/go-vela/worker/executor/local" - - "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/executor/linux" + "github.com/go-vela/worker/executor/local" + "github.com/go-vela/worker/runtime/docker" ) func TestExecutor_New(t *testing.T) { diff --git a/executor/flags.go b/executor/flags.go index e04568b9..9850c322 100644 --- a/executor/flags.go +++ b/executor/flags.go @@ -5,9 +5,9 @@ package executor import ( "time" - "github.com/go-vela/types/constants" - "github.com/urfave/cli/v2" + + "github.com/go-vela/types/constants" ) // Flags represents all supported command line diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 3b1125e2..bf3b1a2a 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -10,9 +10,12 @@ import ( "testing" "time" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + logrusTest "github.com/sirupsen/logrus/hooks/test" + "github.com/urfave/cli/v2" v1 "k8s.io/api/core/v1" - "github.com/gin-gonic/gin" "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler/native" @@ -24,9 +27,6 @@ import ( "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/worker/runtime/kubernetes" - "github.com/sirupsen/logrus" - logrusTest "github.com/sirupsen/logrus/hooks/test" - "github.com/urfave/cli/v2" ) func TestLinux_CreateBuild(t *testing.T) { diff --git a/executor/linux/driver_test.go b/executor/linux/driver_test.go index 4f9d1fca..ffc3a917 100644 --- a/executor/linux/driver_test.go +++ b/executor/linux/driver_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/constants" diff --git a/executor/linux/linux.go b/executor/linux/linux.go index 4cfa71e6..a6f695c3 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -8,13 +8,14 @@ import ( "sync" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" - "github.com/sirupsen/logrus" ) type ( diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index bbf4f82d..daacee41 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/gin-gonic/gin" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/gin-gonic/gin" "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" diff --git a/executor/linux/opts.go b/executor/linux/opts.go index be9902e4..d7dbd943 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -6,13 +6,14 @@ import ( "fmt" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" - "github.com/sirupsen/logrus" ) // Opt represents a configuration option to initialize the executor client for Linux. diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index 6aec5d80..540ec2ac 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -9,6 +9,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" @@ -18,7 +20,6 @@ import ( "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/worker/runtime/kubernetes" - "github.com/sirupsen/logrus" ) func TestLinux_Opt_WithBuild(t *testing.T) { diff --git a/executor/linux/secret.go b/executor/linux/secret.go index 17759d82..bcd74ecc 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -11,13 +11,13 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/step" - - "github.com/sirupsen/logrus" ) // secretSvc handles communication with secret processes during a build. diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 5b458415..9630ceda 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -10,6 +10,9 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/google/go-cmp/cmp" + "github.com/urfave/cli/v2" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" @@ -21,8 +24,6 @@ import ( "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/worker/runtime/kubernetes" - "github.com/google/go-cmp/cmp" - "github.com/urfave/cli/v2" ) func TestLinux_Secret_create(t *testing.T) { diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index ec667658..b3df9bc7 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index cc904261..9b2e0717 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -11,6 +11,8 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/urfave/cli/v2" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" @@ -19,7 +21,6 @@ import ( "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/worker/runtime/kubernetes" - "github.com/urfave/cli/v2" ) func TestLinux_CreateStage(t *testing.T) { diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index b8e1eb3b..51a55af0 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" diff --git a/executor/local/build.go b/executor/local/build.go index 0c682f88..dba1340c 100644 --- a/executor/local/build.go +++ b/executor/local/build.go @@ -8,12 +8,12 @@ import ( "sync" "time" + "github.com/sirupsen/logrus" "golang.org/x/sync/errgroup" "github.com/go-vela/types/constants" "github.com/go-vela/worker/internal/build" "github.com/go-vela/worker/internal/step" - "github.com/sirupsen/logrus" ) // CreateBuild configures the build for execution. diff --git a/executor/local/local_test.go b/executor/local/local_test.go index ab6adb8e..a1f447da 100644 --- a/executor/local/local_test.go +++ b/executor/local/local_test.go @@ -8,15 +8,12 @@ import ( "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" - - "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime/docker" ) func TestEqual(t *testing.T) { diff --git a/executor/local/opts.go b/executor/local/opts.go index 5bef81df..a265630c 100644 --- a/executor/local/opts.go +++ b/executor/local/opts.go @@ -6,14 +6,12 @@ import ( "fmt" "os" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/worker/internal/message" - "github.com/go-vela/worker/runtime" - "github.com/go-vela/sdk-go/vela" - + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime" ) // Opt represents a configuration option to initialize the executor client for Local. diff --git a/executor/local/opts_test.go b/executor/local/opts_test.go index 746f265f..1082651c 100644 --- a/executor/local/opts_test.go +++ b/executor/local/opts_test.go @@ -9,16 +9,13 @@ import ( "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" - - "github.com/go-vela/worker/runtime" - "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime" + "github.com/go-vela/worker/runtime/docker" ) func TestLocal_Opt_WithBuild(t *testing.T) { diff --git a/executor/local/service.go b/executor/local/service.go index f049d1fd..2cd2f9a8 100644 --- a/executor/local/service.go +++ b/executor/local/service.go @@ -8,12 +8,11 @@ import ( "fmt" "time" - "github.com/go-vela/worker/internal/message" - "github.com/go-vela/worker/internal/service" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/internal/service" ) // create a service logging pattern. diff --git a/executor/local/service_test.go b/executor/local/service_test.go index 0c857796..ad766c51 100644 --- a/executor/local/service_test.go +++ b/executor/local/service_test.go @@ -6,11 +6,10 @@ import ( "context" "testing" - "github.com/go-vela/worker/internal/message" - "github.com/go-vela/worker/runtime/docker" - "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime/docker" ) func TestLocal_CreateService(t *testing.T) { diff --git a/executor/local/stage.go b/executor/local/stage.go index abed1868..be708732 100644 --- a/executor/local/stage.go +++ b/executor/local/stage.go @@ -7,9 +7,10 @@ import ( "fmt" "sync" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/step" - "github.com/sirupsen/logrus" ) // create a stage logging pattern. diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go index 05806880..22cca31b 100644 --- a/executor/local/stage_test.go +++ b/executor/local/stage_test.go @@ -12,11 +12,9 @@ import ( "github.com/urfave/cli/v2" "github.com/go-vela/server/compiler/native" - + "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/types/pipeline" ) func TestLocal_CreateStage(t *testing.T) { diff --git a/executor/local/step_test.go b/executor/local/step_test.go index 7db448e0..0dafd57c 100644 --- a/executor/local/step_test.go +++ b/executor/local/step_test.go @@ -6,11 +6,10 @@ import ( "context" "testing" - "github.com/go-vela/worker/internal/message" - "github.com/go-vela/worker/runtime/docker" - "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/message" + "github.com/go-vela/worker/runtime/docker" ) func TestLocal_CreateStep(t *testing.T) { diff --git a/executor/setup.go b/executor/setup.go index 57751531..85065914 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -7,19 +7,16 @@ import ( "strings" "time" - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/worker/executor/linux" - "github.com/go-vela/worker/executor/local" - - "github.com/go-vela/worker/runtime" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - - "github.com/sirupsen/logrus" + "github.com/go-vela/worker/executor/linux" + "github.com/go-vela/worker/executor/local" + "github.com/go-vela/worker/runtime" ) // Setup represents the configuration necessary for diff --git a/executor/setup_test.go b/executor/setup_test.go index 0fd742c0..638582c7 100644 --- a/executor/setup_test.go +++ b/executor/setup_test.go @@ -10,16 +10,12 @@ import ( "github.com/gin-gonic/gin" "github.com/google/go-cmp/cmp" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/mock/server" - + "github.com/go-vela/types/constants" "github.com/go-vela/worker/executor/linux" "github.com/go-vela/worker/executor/local" - "github.com/go-vela/worker/runtime/docker" - - "github.com/go-vela/sdk-go/vela" - - "github.com/go-vela/types/constants" ) func TestExecutor_Setup_Darwin(t *testing.T) { diff --git a/internal/build/snapshot.go b/internal/build/snapshot.go index 8b0f95fb..6d6678f0 100644 --- a/internal/build/snapshot.go +++ b/internal/build/snapshot.go @@ -6,11 +6,12 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Snapshot creates a moment in time record of the build diff --git a/internal/build/snapshot_test.go b/internal/build/snapshot_test.go index 76fb1261..a736c100 100644 --- a/internal/build/snapshot_test.go +++ b/internal/build/snapshot_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/api/types/actions" diff --git a/internal/build/upload.go b/internal/build/upload.go index 681ba3a1..d6650c29 100644 --- a/internal/build/upload.go +++ b/internal/build/upload.go @@ -6,11 +6,12 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Upload tracks the final state of the build diff --git a/internal/build/upload_test.go b/internal/build/upload_test.go index 7718560a..6a210520 100644 --- a/internal/build/upload_test.go +++ b/internal/build/upload_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/api/types/actions" diff --git a/internal/service/snapshot.go b/internal/service/snapshot.go index 97bf0673..499c4d86 100644 --- a/internal/service/snapshot.go +++ b/internal/service/snapshot.go @@ -6,12 +6,13 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // Snapshot creates a moment in time record of the diff --git a/internal/service/snapshot_test.go b/internal/service/snapshot_test.go index 253b57f5..0eb81fed 100644 --- a/internal/service/snapshot_test.go +++ b/internal/service/snapshot_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" diff --git a/internal/service/upload.go b/internal/service/upload.go index 865e793c..94e4df49 100644 --- a/internal/service/upload.go +++ b/internal/service/upload.go @@ -5,12 +5,13 @@ package service import ( "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // Upload tracks the final state of the service diff --git a/internal/service/upload_test.go b/internal/service/upload_test.go index 90ec085a..eb82eb70 100644 --- a/internal/service/upload_test.go +++ b/internal/service/upload_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" diff --git a/internal/step/snapshot.go b/internal/step/snapshot.go index 01aeeb04..537fb3c4 100644 --- a/internal/step/snapshot.go +++ b/internal/step/snapshot.go @@ -6,12 +6,13 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // Snapshot creates a moment in time record of the diff --git a/internal/step/snapshot_test.go b/internal/step/snapshot_test.go index 239bf5a8..0f95915d 100644 --- a/internal/step/snapshot_test.go +++ b/internal/step/snapshot_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" diff --git a/internal/step/upload.go b/internal/step/upload.go index 05a8636c..32c5a23e 100644 --- a/internal/step/upload.go +++ b/internal/step/upload.go @@ -5,12 +5,13 @@ package step import ( "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // Upload tracks the final state of the step diff --git a/internal/step/upload_test.go b/internal/step/upload_test.go index 62a81d4f..944b0f7d 100644 --- a/internal/step/upload_test.go +++ b/internal/step/upload_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" diff --git a/mock/worker/build.go b/mock/worker/build.go index 761c92b5..7db1e7a8 100644 --- a/mock/worker/build.go +++ b/mock/worker/build.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/worker/executor.go b/mock/worker/executor.go index 9662b077..0b5326fb 100644 --- a/mock/worker/executor.go +++ b/mock/worker/executor.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/worker/pipeline.go b/mock/worker/pipeline.go index b4d0f873..d87b49b9 100644 --- a/mock/worker/pipeline.go +++ b/mock/worker/pipeline.go @@ -8,10 +8,10 @@ import ( "net/http" "strings" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + "github.com/go-vela/types" + "github.com/go-vela/types/library" ) const ( diff --git a/mock/worker/repo.go b/mock/worker/repo.go index c0071de4..766097bf 100644 --- a/mock/worker/repo.go +++ b/mock/worker/repo.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types" ) diff --git a/router/executor.go b/router/executor.go index 8104ee8f..125f74bf 100644 --- a/router/executor.go +++ b/router/executor.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" "github.com/go-vela/worker/router/middleware/executor" ) diff --git a/router/middleware/executor/executor.go b/router/middleware/executor/executor.go index eeb3fdcd..6954b975 100644 --- a/router/middleware/executor/executor.go +++ b/router/middleware/executor/executor.go @@ -8,11 +8,10 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" "github.com/go-vela/types" "github.com/go-vela/worker/executor" - - "github.com/sirupsen/logrus" ) // Retrieve gets the repo in the given context. diff --git a/router/middleware/header.go b/router/middleware/header.go index 3fd4c10c..85a6b562 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -7,6 +7,7 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/go-vela/worker/version" ) diff --git a/router/middleware/logger_test.go b/router/middleware/logger_test.go index 83c8d374..2e80ad4f 100644 --- a/router/middleware/logger_test.go +++ b/router/middleware/logger_test.go @@ -13,7 +13,6 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" "github.com/sirupsen/logrus/hooks/test" ) diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index ad73490e..a6ff7b88 100644 --- a/router/middleware/perm/perm.go +++ b/router/middleware/perm/perm.go @@ -7,12 +7,12 @@ import ( "net/http" "strings" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types" "github.com/go-vela/worker/router/middleware/token" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // MustServer ensures the caller is the vela server. diff --git a/router/router.go b/router/router.go index fb0ecb99..1c005951 100644 --- a/router/router.go +++ b/router/router.go @@ -26,6 +26,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/worker/api" "github.com/go-vela/worker/router/middleware" "github.com/go-vela/worker/router/middleware/perm" diff --git a/runtime/docker/container.go b/runtime/docker/container.go index b4733350..f9c5bb66 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -8,12 +8,11 @@ import ( "io" "strings" - "github.com/go-vela/types/constants" - dockerContainerTypes "github.com/docker/docker/api/types/container" docker "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" + "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" ) diff --git a/runtime/docker/docker.go b/runtime/docker/docker.go index fcbc467e..af74bb4a 100644 --- a/runtime/docker/docker.go +++ b/runtime/docker/docker.go @@ -4,8 +4,9 @@ package docker import ( docker "github.com/docker/docker/client" - mock "github.com/go-vela/worker/mock/docker" "github.com/sirupsen/logrus" + + mock "github.com/go-vela/worker/mock/docker" ) // Version represents the supported Docker API version for the mock. diff --git a/runtime/docker/docker_test.go b/runtime/docker/docker_test.go index ee159675..c91b9d54 100644 --- a/runtime/docker/docker_test.go +++ b/runtime/docker/docker_test.go @@ -5,9 +5,9 @@ package docker import ( "testing" - "github.com/go-vela/types/pipeline" - "gotest.tools/v3/env" + + "github.com/go-vela/types/pipeline" ) func TestDocker_New(t *testing.T) { diff --git a/runtime/docker/image.go b/runtime/docker/image.go index 987c1213..e20c5b52 100644 --- a/runtime/docker/image.go +++ b/runtime/docker/image.go @@ -10,11 +10,11 @@ import ( "strings" dockerImageTypes "github.com/docker/docker/api/types/image" + "github.com/sirupsen/logrus" "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" - "github.com/sirupsen/logrus" ) // CreateImage creates the pipeline container image. diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index ea09ae9d..dee10f5c 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -11,12 +11,11 @@ import ( "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/volume" "github.com/docker/go-units" + "github.com/sirupsen/logrus" "github.com/go-vela/types/constants" "github.com/go-vela/types/pipeline" vol "github.com/go-vela/worker/internal/volume" - - "github.com/sirupsen/logrus" ) // CreateVolume creates the pipeline volume. diff --git a/runtime/flags.go b/runtime/flags.go index a7bbf3a8..7a65da6c 100644 --- a/runtime/flags.go +++ b/runtime/flags.go @@ -3,9 +3,9 @@ package runtime import ( - "github.com/go-vela/types/constants" - "github.com/urfave/cli/v2" + + "github.com/go-vela/types/constants" ) // Flags represents all supported command line diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index c5c27a5f..eb145f7f 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -7,16 +7,15 @@ import ( "fmt" "time" - "github.com/go-vela/types/pipeline" - "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/cache" - // The k8s libraries have some quirks around yaml marshaling (see opts.go). // So, just use the same library for all kubernetes-related YAML. "sigs.k8s.io/yaml" + + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" ) // InspectBuild displays details about the pod for the init step. diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index 02bab009..851bbe27 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -7,11 +7,11 @@ import ( "reflect" "testing" - "github.com/go-vela/types/pipeline" - velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/go-vela/types/pipeline" + velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" ) func TestKubernetes_InspectBuild(t *testing.T) { diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index e66d348f..5c7bd47f 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -10,14 +10,14 @@ import ( "strings" "time" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" - "github.com/go-vela/worker/internal/image" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/pipeline" + "github.com/go-vela/worker/internal/image" ) // InspectContainer inspects the pipeline container. diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index f945fafe..d7dc2116 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -7,12 +7,12 @@ import ( "reflect" "testing" + "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" + "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" - - "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" ) func TestKubernetes_InspectContainer(t *testing.T) { diff --git a/runtime/kubernetes/kubernetes.go b/runtime/kubernetes/kubernetes.go index 2c81b06c..400c31b5 100644 --- a/runtime/kubernetes/kubernetes.go +++ b/runtime/kubernetes/kubernetes.go @@ -3,6 +3,7 @@ package kubernetes import ( + "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -10,7 +11,6 @@ import ( velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" velaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned" - "github.com/sirupsen/logrus" ) type config struct { diff --git a/runtime/kubernetes/kubernetes_test.go b/runtime/kubernetes/kubernetes_test.go index 72c60f15..2804b615 100644 --- a/runtime/kubernetes/kubernetes_test.go +++ b/runtime/kubernetes/kubernetes_test.go @@ -5,10 +5,10 @@ package kubernetes import ( "testing" - "github.com/go-vela/types/pipeline" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/go-vela/types/pipeline" ) func TestKubernetes_New(t *testing.T) { diff --git a/runtime/kubernetes/mock.go b/runtime/kubernetes/mock.go index 24801d33..14fe8b4f 100644 --- a/runtime/kubernetes/mock.go +++ b/runtime/kubernetes/mock.go @@ -8,6 +8,7 @@ package kubernetes import ( "context" + "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" @@ -15,7 +16,6 @@ import ( velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" fakeVelaK8sClient "github.com/go-vela/worker/runtime/kubernetes/generated/clientset/versioned/fake" - "github.com/sirupsen/logrus" ) // NewMock returns an Engine implementation that diff --git a/runtime/kubernetes/opts.go b/runtime/kubernetes/opts.go index 424f52bb..c15ac5d4 100644 --- a/runtime/kubernetes/opts.go +++ b/runtime/kubernetes/opts.go @@ -7,7 +7,6 @@ import ( "os" "github.com/sirupsen/logrus" - // The k8s libraries have some quirks around yaml marshaling. // They use `json` instead of `yaml` to annotate their struct Tags. // So, we need to use "sigs.k8s.io/yaml" instead of "github.com/buildkite/yaml". diff --git a/runtime/kubernetes/pod_tracker.go b/runtime/kubernetes/pod_tracker.go index 4f763968..a94dc2e6 100644 --- a/runtime/kubernetes/pod_tracker.go +++ b/runtime/kubernetes/pod_tracker.go @@ -9,7 +9,6 @@ import ( "time" "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" diff --git a/runtime/kubernetes/pod_tracker_test.go b/runtime/kubernetes/pod_tracker_test.go index e149ac99..99f159fd 100644 --- a/runtime/kubernetes/pod_tracker_test.go +++ b/runtime/kubernetes/pod_tracker_test.go @@ -9,7 +9,6 @@ import ( "time" "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" diff --git a/runtime/kubernetes/volume_test.go b/runtime/kubernetes/volume_test.go index fd1c0f24..ae5ca329 100644 --- a/runtime/kubernetes/volume_test.go +++ b/runtime/kubernetes/volume_test.go @@ -6,9 +6,9 @@ import ( "context" "testing" - "github.com/go-vela/types/pipeline" - v1 "k8s.io/api/core/v1" + + "github.com/go-vela/types/pipeline" ) func TestKubernetes_CreateVolume(t *testing.T) { diff --git a/runtime/runtime.go b/runtime/runtime.go index bfcdd206..a3889bfb 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -5,8 +5,9 @@ package runtime import ( "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // New creates and returns a Vela engine capable of diff --git a/runtime/setup.go b/runtime/setup.go index e80846fe..7c491223 100644 --- a/runtime/setup.go +++ b/runtime/setup.go @@ -6,15 +6,13 @@ import ( "fmt" "strings" - "github.com/go-vela/worker/runtime/docker" - "github.com/go-vela/worker/runtime/kubernetes" - "github.com/docker/docker/oci/caps" - - "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" + + "github.com/go-vela/types/constants" + "github.com/go-vela/worker/runtime/docker" + "github.com/go-vela/worker/runtime/kubernetes" ) // Setup represents the configuration necessary for diff --git a/version/version.go b/version/version.go index f6dfde32..f363d79b 100644 --- a/version/version.go +++ b/version/version.go @@ -7,8 +7,9 @@ import ( "runtime" "github.com/Masterminds/semver/v3" - "github.com/go-vela/types/version" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/version" ) var (