Skip to content

Commit 202621e

Browse files
committed
Update to the latest version of golint
1 parent 360bc0a commit 202621e

File tree

9 files changed

+388
-11
lines changed

9 files changed

+388
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ tidy:
4242
go mod tidy
4343

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

4848
test:

cmd/printers/json/formatter_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ func TestFormatter_FormatDeleteEvent(t *testing.T) {
397397
}
398398
}
399399

400+
// nolint:unparam
400401
func assertOutput(t *testing.T, expectedMap map[string]interface{}, actual string) bool {
401402
var m map[string]interface{}
402403
err := json.Unmarshal([]byte(actual), &m)

go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ go 1.13
44

55
require (
66
github.com/go-errors/errors v1.0.1
7+
github.com/golangci/golangci-lint v1.31.0 // indirect
78
github.com/google/uuid v1.1.1
89
github.com/pkg/errors v0.9.1
910
github.com/spf13/cobra v1.0.0
10-
github.com/stretchr/testify v1.4.0
11-
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
12-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 // indirect
13-
gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71
11+
github.com/stretchr/testify v1.6.1
12+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
1413
gotest.tools v2.2.0+incompatible
1514
k8s.io/api v0.17.2
1615
k8s.io/apiextensions-apiserver v0.17.2

go.sum

Lines changed: 377 additions & 0 deletions
Large diffs are not rendered by default.

pkg/apply/taskrunner/runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func (b *baseRunner) run(ctx context.Context, taskQueue chan Task,
159159
// If the statusChannel has closed or we are preparing
160160
// to abort the task processing, we just ignore all
161161
// statusEvents.
162-
//TODO(mortent): Check if a losed statusChannel might
162+
// TODO(mortent): Check if a losed statusChannel might
163163
// create a busy loop here.
164164
if !ok || abort {
165165
continue

pkg/apply/taskrunner/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (w *WaitTask) Start(taskContext *TaskContext) {
7474
func (w *WaitTask) setTimer(taskContext *TaskContext) {
7575
timer := time.NewTimer(w.Timeout)
7676
go func() {
77-
//TODO(mortent): See if there is a better way to do this. This
77+
// TODO(mortent): See if there is a better way to do this. This
7878
// solution will cause the goroutine to hang forever if the
7979
// Timeout is cancelled.
8080
<-timer.C

pkg/common/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const (
3535
// random number seeded with the parameter.
3636
func RandomStr(seed int64) string {
3737
rand.Seed(seed)
38-
randomInt := rand.Intn(maxRandInt)
38+
randomInt := rand.Intn(maxRandInt) // nolint:gosec
3939
return fmt.Sprintf("%08d", randomInt)
4040
}
4141

pkg/kstatus/status/core.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func deploymentConditions(u *unstructured.Unstructured) (*Result, error) {
179179

180180
for _, c := range objc.Status.Conditions {
181181
switch c.Type {
182-
case "Progressing": //appsv1.DeploymentProgressing:
182+
case "Progressing": // appsv1.DeploymentProgressing:
183183
// https://github.com/kubernetes/kubernetes/blob/a3ccea9d8743f2ff82e41b6c2af6dc2c41dc7b10/pkg/controller/deployment/progress.go#L52
184184
if c.Reason == "ProgressDeadlineExceeded" {
185185
return &Result{
@@ -191,7 +191,7 @@ func deploymentConditions(u *unstructured.Unstructured) (*Result, error) {
191191
if c.Status == corev1.ConditionTrue && c.Reason == "NewReplicaSetAvailable" {
192192
progressing = true
193193
}
194-
case "Available": //appsv1.DeploymentAvailable:
194+
case "Available": // appsv1.DeploymentAvailable:
195195
if c.Status == corev1.ConditionTrue {
196196
available = true
197197
}

pkg/kstatus/status/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func FromStringOrDie(text string) Status {
6363
// Result contains the results of a call to compute the status of
6464
// a resource.
6565
type Result struct {
66-
//Status
66+
// Status
6767
Status Status
6868
// Message
6969
Message string

0 commit comments

Comments
 (0)