Skip to content

Commit 3bf0207

Browse files
renovate[bot]guewa
andauthored
chore(deps): update hack/common digest to 80bfca5 (#51)
* chore(deps): update hack/common digest to 80bfca5 * chore(fix): golang-lint v2 changes --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Günther Wannenmacher <guenther.wannenmacher@sap.com>
1 parent dbcffa3 commit 3bf0207

File tree

6 files changed

+70
-29
lines changed

6 files changed

+70
-29
lines changed

.golangci.yaml

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,49 @@
1+
version: "2"
12
run:
2-
concurrency: 4
3-
timeout: 10m
4-
5-
issues:
6-
exclude-files:
7-
- "zz_generated.*\\.go$"
8-
- "tmp/.*"
3+
allow-parallel-runners: true
4+
linters:
5+
default: none
6+
enable:
7+
- copyloopvar
8+
# - dupl
9+
- errcheck
10+
# - ginkgolinter
11+
# - goconst
12+
- gocyclo
13+
- govet
14+
- ineffassign
15+
- misspell
16+
- nakedret
17+
# - prealloc
18+
# - revive
19+
- staticcheck
20+
- unconvert
21+
- unparam
22+
- unused
23+
settings:
24+
revive:
25+
rules:
26+
- name: comment-spacings
27+
exclusions:
28+
generated: lax
29+
presets:
30+
- comments
31+
- common-false-positives
32+
- legacy
33+
- std-error-handling
34+
paths:
35+
- zz_generated.*\.go$
36+
- tmp/.*
37+
- third_party$
38+
- builtin$
39+
- examples$
40+
formatters:
41+
enable:
42+
- gofmt
43+
- goimports
44+
exclusions:
45+
generated: lax
46+
paths:
47+
- third_party$
48+
- builtin$
49+
- examples$

pkg/clientconfig/clientconfig.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ func copyRestConfig(from, to *rest.Config) {
237237
to.AuthProvider = from.AuthProvider
238238
to.AuthConfigPersister = from.AuthConfigPersister
239239
to.ExecProvider = from.ExecProvider
240-
to.TLSClientConfig.Insecure = from.TLSClientConfig.Insecure
241-
to.TLSClientConfig.ServerName = from.TLSClientConfig.ServerName
242-
to.TLSClientConfig.CertFile = from.TLSClientConfig.CertFile
243-
to.TLSClientConfig.KeyFile = from.TLSClientConfig.KeyFile
244-
to.TLSClientConfig.CAFile = from.TLSClientConfig.CAFile
245-
to.TLSClientConfig.CertData = from.TLSClientConfig.CertData
246-
to.TLSClientConfig.KeyData = from.TLSClientConfig.KeyData
247-
to.TLSClientConfig.CAData = from.TLSClientConfig.CAData
248-
to.TLSClientConfig.NextProtos = from.TLSClientConfig.NextProtos
240+
to.Insecure = from.Insecure
241+
to.ServerName = from.ServerName
242+
to.CertFile = from.CertFile
243+
to.KeyFile = from.KeyFile
244+
to.CAFile = from.CAFile
245+
to.CertData = from.CertData
246+
to.KeyData = from.KeyData
247+
to.CAData = from.CAData
248+
to.NextProtos = from.NextProtos
249249
to.UserAgent = from.UserAgent
250250
to.DisableCompression = from.DisableCompression
251251
to.Transport = from.Transport

pkg/collections/list-linked.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NewLinkedList[T any](elements ...T) *LinkedList[T] {
4040
res.dummy.next = res.dummy
4141
res.dummy.prev = res.dummy
4242

43-
res.abstractCollection.funcIterator = res.Iterator
43+
res.funcIterator = res.Iterator
4444
res.funcAdd = res.Add
4545
res.funcClear = res.Clear
4646
res.funcRemove = res.Remove

pkg/controller/annotation_label_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ var _ = Describe("Annotation/Label Library", func() {
2020
Context("IsMetadataEntryAlreadyExistsError", func() {
2121

2222
It("should return true if the error is of type IsMetadataEntryAlreadyExistsError", func() {
23-
var err error = ctrlutils.NewMetadataEntryAlreadyExistsError(ctrlutils.ANNOTATION, "test-annotation", "desired-value", "actual-value")
23+
err := ctrlutils.NewMetadataEntryAlreadyExistsError(ctrlutils.ANNOTATION, "test-annotation", "desired-value", "actual-value")
2424
Expect(ctrlutils.IsMetadataEntryAlreadyExistsError(err)).To(BeTrue())
2525
})
2626

2727
It("should return false if the error is not of type IsMetadataEntryAlreadyExistsError", func() {
28-
var err error = fmt.Errorf("test-error")
28+
err := fmt.Errorf("test-error")
2929
Expect(ctrlutils.IsMetadataEntryAlreadyExistsError(err)).To(BeFalse())
3030
})
3131

@@ -213,12 +213,12 @@ var _ = Describe("Annotation/Label Library", func() {
213213
Context("IsMetadataEntryAlreadyExistsError", func() {
214214

215215
It("should return true if the error is of type IsMetadataEntryAlreadyExistsError", func() {
216-
var err error = ctrlutils.NewMetadataEntryAlreadyExistsError(ctrlutils.LABEL, "test-label", "desired-value", "actual-value")
216+
err := ctrlutils.NewMetadataEntryAlreadyExistsError(ctrlutils.LABEL, "test-label", "desired-value", "actual-value")
217217
Expect(ctrlutils.IsMetadataEntryAlreadyExistsError(err)).To(BeTrue())
218218
})
219219

220220
It("should return false if the error is not of type IsMetadataEntryAlreadyExistsError", func() {
221-
var err error = fmt.Errorf("test-error")
221+
err := fmt.Errorf("test-error")
222222
Expect(ctrlutils.IsMetadataEntryAlreadyExistsError(err)).To(BeFalse())
223223
})
224224

pkg/testing/complex_environment.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"time"
99

10-
. "github.com/onsi/gomega"
10+
"github.com/onsi/gomega"
1111
"k8s.io/apimachinery/pkg/runtime"
1212
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
1313
ctrl "sigs.k8s.io/controller-runtime"
@@ -61,7 +61,7 @@ func (e *ComplexEnvironment) ShouldReconcile(reconciler string, req reconcile.Re
6161

6262
func (e *ComplexEnvironment) shouldReconcile(reconciler string, req reconcile.Request, optionalDescription ...interface{}) reconcile.Result {
6363
res, err := e.Reconcilers[reconciler].Reconcile(e.Ctx, req)
64-
ExpectWithOffset(2, err).ToNot(HaveOccurred(), optionalDescription...)
64+
gomega.ExpectWithOffset(2, err).ToNot(gomega.HaveOccurred(), optionalDescription...)
6565
return res
6666
}
6767

@@ -73,10 +73,10 @@ func (e *ComplexEnvironment) ShouldEventuallyReconcile(reconciler string, req re
7373
func (e *ComplexEnvironment) shouldEventuallyReconcile(reconciler string, req reconcile.Request, timeout, poll time.Duration, optionalDescription ...interface{}) reconcile.Result {
7474
var err error
7575
var res reconcile.Result
76-
EventuallyWithOffset(1, func() error {
76+
gomega.EventuallyWithOffset(1, func() error {
7777
res, err = e.Reconcilers[reconciler].Reconcile(e.Ctx, req)
7878
return err
79-
}, timeout, poll).Should(Succeed(), optionalDescription...)
79+
}, timeout, poll).Should(gomega.Succeed(), optionalDescription...)
8080
return res
8181
}
8282

@@ -87,7 +87,7 @@ func (e *ComplexEnvironment) ShouldNotReconcile(reconciler string, req reconcile
8787

8888
func (e *ComplexEnvironment) shouldNotReconcile(reconciler string, req reconcile.Request, optionalDescription ...interface{}) reconcile.Result {
8989
res, err := e.Reconcilers[reconciler].Reconcile(e.Ctx, req)
90-
ExpectWithOffset(2, err).To(HaveOccurred(), optionalDescription...)
90+
gomega.ExpectWithOffset(2, err).To(gomega.HaveOccurred(), optionalDescription...)
9191
return res
9292
}
9393

@@ -99,10 +99,10 @@ func (e *ComplexEnvironment) ShouldEventuallyNotReconcile(reconciler string, req
9999
func (e *ComplexEnvironment) shouldEventuallyNotReconcile(reconciler string, req reconcile.Request, timeout, poll time.Duration, optionalDescription ...interface{}) reconcile.Result {
100100
var err error
101101
var res reconcile.Result
102-
EventuallyWithOffset(1, func() error {
102+
gomega.EventuallyWithOffset(1, func() error {
103103
res, err = e.Reconcilers[reconciler].Reconcile(e.Ctx, req)
104104
return err
105-
}, timeout, poll).ShouldNot(Succeed(), optionalDescription...)
105+
}, timeout, poll).ShouldNot(gomega.Succeed(), optionalDescription...)
106106
return res
107107
}
108108

0 commit comments

Comments
 (0)