Skip to content

Commit

Permalink
Run goimports
Browse files Browse the repository at this point in the history
  • Loading branch information
sayboras committed Nov 9, 2019
1 parent 172b53e commit 5db8b9b
Show file tree
Hide file tree
Showing 22 changed files with 91 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run:
concurrency: 4

# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 5m
timeout: 5m

# exit code when at least one issue was found, default is 1
issues-exit-code: 1
Expand Down Expand Up @@ -161,8 +161,8 @@ linters:
- errcheck
- deadcode
- misspell
- goimports
# TODO: enable the below linter in the future
# - goimports
# - maligned
# - prealloc
# - gocyclo
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ endif

.PHONY: lint
lint: ## Run linter over the codebase
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
# Install golangci-lint here till the build docker image is updated
go get github.com/golangci/golangci-lint/cmd/golangci-lint
time "$(GOBIN)/golangci-lint" run

.PHONY: test
Expand Down
7 changes: 4 additions & 3 deletions cmd/schema/generate.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package main

import (
"github.com/alecthomas/jsonschema"
api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
"io/ioutil"
"os"
"sigs.k8s.io/yaml"
"strings"

"github.com/alecthomas/jsonschema"
api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
"sigs.k8s.io/yaml"
)

func main() {
Expand Down
1 change: 0 additions & 1 deletion integration/gitopscreateprofile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

. "github.com/weaveworks/eksctl/integration/runner"
"github.com/weaveworks/eksctl/pkg/ctl/cmdutils"

)

var _ = Describe("(Integration) generate profile", func() {
Expand Down
3 changes: 0 additions & 3 deletions pkg/addons/vpc_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ func watchCSRApproval(csrClientSet v1beta1.CertificateSigningRequestInterface, c
}

}

return nil, errors.New("unexpected termination of loop")

}

func (v *VPCController) createCertSecrets(key, cert []byte) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/authconfigmap/authconfigmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/typed/core/v1"
v1 "k8s.io/client-go/kubernetes/typed/core/v1"
"sigs.k8s.io/yaml"

api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
Expand Down
2 changes: 1 addition & 1 deletion pkg/authconfigmap/authconfigmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/typed/core/v1"
v1 "k8s.io/client-go/kubernetes/typed/core/v1"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cfn/builder/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func testVPC() *api.ClusterVPC {
},
},
},
ClusterEndpoints: &api.ClusterEndpoints {
ClusterEndpoints: &api.ClusterEndpoints{
PrivateAccess: api.Disabled(),
PublicAccess: api.Enabled(),
},
Expand Down
1 change: 1 addition & 0 deletions pkg/cfn/manager/nodegroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package manager

import (
"fmt"

"github.com/aws/aws-sdk-go/aws"
cfn "github.com/aws/aws-sdk-go/service/cloudformation"
. "github.com/onsi/ginkgo"
Expand Down
2 changes: 1 addition & 1 deletion pkg/ctl/cmdutils/cmdutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func ErrUnsupportedRegion(provider *api.ProviderConfig) error {
// ErrClusterFlagAndArg wraps ErrFlagAndArg() by passing in the
// proper flag name.
func ErrClusterFlagAndArg(cmd *Cmd, nameFlag, nameArg string) error {
return ErrFlagAndArg(ClusterNameFlag(cmd), nameFlag, nameArg)
return ErrFlagAndArg(ClusterNameFlag(cmd), nameFlag, nameArg)
}

// ErrFlagAndArg may be used to err for options that can be given
Expand Down
5 changes: 4 additions & 1 deletion pkg/ctl/enable/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ func configureRepositoryCmd(cmd *cmdutils.Cmd) *flux.InstallOpts {

// doEnableRepository enables GitOps on the configured repository.
func doEnableRepository(cmd *cmdutils.Cmd, opts *flux.InstallOpts) error {
cmdutils.ValidateGitOptions(&opts.GitOptions)
err := cmdutils.ValidateGitOptions(&opts.GitOptions)
if err != nil {
return err
}
if err := cmdutils.NewGitOpsConfigLoader(cmd).Load(); err != nil {
return err
}
Expand Down
12 changes: 8 additions & 4 deletions pkg/eks/mocks/CloudFormationAPI.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/eks/mocks/CloudTrailAPI.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/eks/mocks/EC2API.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/eks/mocks/EKSAPI.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/eks/mocks/ELBAPI.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/eks/mocks/ELBV2API.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/eks/mocks/IAMAPI.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/eks/mocks/SSMAPI.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/eks/mocks/STSAPI.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/eks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"github.com/kris-nova/logger"
"github.com/pkg/errors"
"github.com/weaveworks/eksctl/pkg/addons"
iamoidc "github.com/weaveworks/eksctl/pkg/iam/oidc"

api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5"
"github.com/weaveworks/eksctl/pkg/cfn/manager"
"github.com/weaveworks/eksctl/pkg/iam/oidc"
"github.com/weaveworks/eksctl/pkg/kubernetes"
)

Expand Down
2 changes: 1 addition & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

_ "github.com/dave/jennifer/jen"
_ "github.com/gohugoio/hugo"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/goreleaser/goreleaser"
_ "github.com/kevinburke/go-bindata/go-bindata"
_ "github.com/kubernetes-sigs/aws-iam-authenticator/cmd/aws-iam-authenticator"
Expand All @@ -26,5 +27,4 @@ import (
_ "k8s.io/code-generator/cmd/defaulter-gen"
_ "k8s.io/code-generator/cmd/informer-gen"
_ "k8s.io/code-generator/cmd/lister-gen"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
)

0 comments on commit 5db8b9b

Please sign in to comment.