Skip to content

Commit

Permalink
Merge pull request #248 from mortent/UpdateGolintVersion
Browse files Browse the repository at this point in the history
Update to the latest version of golint
  • Loading branch information
k8s-ci-robot authored Oct 5, 2020
2 parents 360bc0a + 202621e commit edf435f
Show file tree
Hide file tree
Showing 9 changed files with 388 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tidy:
go mod tidy

lint:
(which $(GOPATH)/bin/golangci-lint || go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.19.1)
(which $(GOPATH)/bin/golangci-lint || go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.31.0)
$(GOPATH)/bin/golangci-lint run ./...

test:
Expand Down
1 change: 1 addition & 0 deletions cmd/printers/json/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ func TestFormatter_FormatDeleteEvent(t *testing.T) {
}
}

// nolint:unparam
func assertOutput(t *testing.T, expectedMap map[string]interface{}, actual string) bool {
var m map[string]interface{}
err := json.Unmarshal([]byte(actual), &m)
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ go 1.13

require (
github.com/go-errors/errors v1.0.1
github.com/golangci/golangci-lint v1.31.0 // indirect
github.com/google/uuid v1.1.1
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.0.0
github.com/stretchr/testify v1.4.0
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 // indirect
gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71
github.com/stretchr/testify v1.6.1
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
gotest.tools v2.2.0+incompatible
k8s.io/api v0.17.2
k8s.io/apiextensions-apiserver v0.17.2
Expand Down
377 changes: 377 additions & 0 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/apply/taskrunner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (b *baseRunner) run(ctx context.Context, taskQueue chan Task,
// If the statusChannel has closed or we are preparing
// to abort the task processing, we just ignore all
// statusEvents.
//TODO(mortent): Check if a losed statusChannel might
// TODO(mortent): Check if a losed statusChannel might
// create a busy loop here.
if !ok || abort {
continue
Expand Down
2 changes: 1 addition & 1 deletion pkg/apply/taskrunner/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (w *WaitTask) Start(taskContext *TaskContext) {
func (w *WaitTask) setTimer(taskContext *TaskContext) {
timer := time.NewTimer(w.Timeout)
go func() {
//TODO(mortent): See if there is a better way to do this. This
// TODO(mortent): See if there is a better way to do this. This
// solution will cause the goroutine to hang forever if the
// Timeout is cancelled.
<-timer.C
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
// random number seeded with the parameter.
func RandomStr(seed int64) string {
rand.Seed(seed)
randomInt := rand.Intn(maxRandInt)
randomInt := rand.Intn(maxRandInt) // nolint:gosec
return fmt.Sprintf("%08d", randomInt)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/kstatus/status/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func deploymentConditions(u *unstructured.Unstructured) (*Result, error) {

for _, c := range objc.Status.Conditions {
switch c.Type {
case "Progressing": //appsv1.DeploymentProgressing:
case "Progressing": // appsv1.DeploymentProgressing:
// https://github.com/kubernetes/kubernetes/blob/a3ccea9d8743f2ff82e41b6c2af6dc2c41dc7b10/pkg/controller/deployment/progress.go#L52
if c.Reason == "ProgressDeadlineExceeded" {
return &Result{
Expand All @@ -191,7 +191,7 @@ func deploymentConditions(u *unstructured.Unstructured) (*Result, error) {
if c.Status == corev1.ConditionTrue && c.Reason == "NewReplicaSetAvailable" {
progressing = true
}
case "Available": //appsv1.DeploymentAvailable:
case "Available": // appsv1.DeploymentAvailable:
if c.Status == corev1.ConditionTrue {
available = true
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kstatus/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func FromStringOrDie(text string) Status {
// Result contains the results of a call to compute the status of
// a resource.
type Result struct {
//Status
// Status
Status Status
// Message
Message string
Expand Down

0 comments on commit edf435f

Please sign in to comment.