From f314f4f3a0e2207f070d0862ff2d7e37fa3118b0 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 26 Jul 2019 21:29:49 +0200 Subject: [PATCH] Format sources and order imports with the help of goimports Keeps it nice and tidy and probably just prevents future merge conflicts. --- cmd/argoexec/commands/root.go | 7 +++---- test/e2e/e2e_test.go | 2 +- util/file/fileutil_test.go | 6 ++++-- workflow/artifacts/raw/raw_test.go | 3 ++- workflow/controller/controller_test.go | 8 ++++---- workflow/controller/dag.go | 3 ++- workflow/controller/operator_test.go | 14 +++++++------- workflow/executor/executor.go | 5 ++--- 8 files changed, 25 insertions(+), 23 deletions(-) diff --git a/cmd/argoexec/commands/root.go b/cmd/argoexec/commands/root.go index 5f716420925b..d1697ad972aa 100644 --- a/cmd/argoexec/commands/root.go +++ b/cmd/argoexec/commands/root.go @@ -4,16 +4,13 @@ import ( "encoding/json" "os" - "github.com/argoproj/argo/util" - - "github.com/argoproj/pkg/cli" - kubecli "github.com/argoproj/pkg/kube/cli" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" "github.com/argoproj/argo" + "github.com/argoproj/argo/util" "github.com/argoproj/argo/util/cmd" "github.com/argoproj/argo/workflow/common" "github.com/argoproj/argo/workflow/executor" @@ -21,6 +18,8 @@ import ( "github.com/argoproj/argo/workflow/executor/k8sapi" "github.com/argoproj/argo/workflow/executor/kubelet" "github.com/argoproj/argo/workflow/executor/pns" + "github.com/argoproj/pkg/cli" + kubecli "github.com/argoproj/pkg/kube/cli" ) const ( diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 5a8e25246ceb..69738e091ffd 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -3,7 +3,7 @@ package e2e import ( "flag" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/util/file/fileutil_test.go b/util/file/fileutil_test.go index 32379866afb2..5ec5dce60233 100644 --- a/util/file/fileutil_test.go +++ b/util/file/fileutil_test.go @@ -3,10 +3,12 @@ package file_test import ( "archive/tar" "bytes" - "github.com/argoproj/argo/util/file" - "github.com/stretchr/testify/assert" "os" "testing" + + "github.com/stretchr/testify/assert" + + "github.com/argoproj/argo/util/file" ) // TestResubmitWorkflowWithOnExit ensures we do not carry over the onExit node even if successful diff --git a/workflow/artifacts/raw/raw_test.go b/workflow/artifacts/raw/raw_test.go index e77506f80495..aa1a327fb08b 100644 --- a/workflow/artifacts/raw/raw_test.go +++ b/workflow/artifacts/raw/raw_test.go @@ -6,9 +6,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/workflow/artifacts/raw" - "github.com/stretchr/testify/assert" ) const ( diff --git a/workflow/controller/controller_test.go b/workflow/controller/controller_test.go index 684d1ff0fa56..6a1fa220af17 100644 --- a/workflow/controller/controller_test.go +++ b/workflow/controller/controller_test.go @@ -7,16 +7,16 @@ import ( "io/ioutil" "testing" - "github.com/argoproj/argo/workflow/config" - - wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" - fakewfclientset "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" + + wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" + fakewfclientset "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" + "github.com/argoproj/argo/workflow/config" ) var helloWorldWf = ` diff --git a/workflow/controller/dag.go b/workflow/controller/dag.go index 5017d8095c64..deec2ce43439 100644 --- a/workflow/controller/dag.go +++ b/workflow/controller/dag.go @@ -5,10 +5,11 @@ import ( "fmt" "strings" + "github.com/valyala/fasttemplate" + "github.com/argoproj/argo/errors" wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/workflow/common" - "github.com/valyala/fasttemplate" ) // dagContext holds context information about this context's DAG diff --git a/workflow/controller/operator_test.go b/workflow/controller/operator_test.go index ab39e747eb2c..66c631063952 100644 --- a/workflow/controller/operator_test.go +++ b/workflow/controller/operator_test.go @@ -6,17 +6,17 @@ import ( "strings" "testing" - "github.com/argoproj/argo/workflow/config" - - wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" - "github.com/argoproj/argo/test" - "github.com/argoproj/argo/workflow/common" - "github.com/argoproj/argo/workflow/util" "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" apiv1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" + "github.com/argoproj/argo/test" + "github.com/argoproj/argo/workflow/common" + "github.com/argoproj/argo/workflow/config" + "github.com/argoproj/argo/workflow/util" ) // TestOperateWorkflowPanicRecover ensures we can recover from unexpected panics @@ -1458,7 +1458,7 @@ spec: - name: message value: "{{item}}" withParam: "{{workflow.parameters.input}}" - - name: whalesay + - name: whalesay inputs: parameters: - name: message diff --git a/workflow/executor/executor.go b/workflow/executor/executor.go index 755559333828..d2b8fa4748b8 100644 --- a/workflow/executor/executor.go +++ b/workflow/executor/executor.go @@ -19,9 +19,6 @@ import ( "syscall" "time" - "github.com/argoproj/argo/util" - - argofile "github.com/argoproj/pkg/file" log "github.com/sirupsen/logrus" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -32,6 +29,7 @@ import ( "github.com/argoproj/argo/errors" wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" + "github.com/argoproj/argo/util" "github.com/argoproj/argo/util/archive" "github.com/argoproj/argo/util/retry" artifact "github.com/argoproj/argo/workflow/artifacts" @@ -42,6 +40,7 @@ import ( "github.com/argoproj/argo/workflow/artifacts/raw" "github.com/argoproj/argo/workflow/artifacts/s3" "github.com/argoproj/argo/workflow/common" + argofile "github.com/argoproj/pkg/file" ) const (