Skip to content

Commit 55651d9

Browse files
committed
Update golangci-lint and Go version for lint workflow
1 parent 5c44a14 commit 55651d9

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: golangci-lint
22
on:
33
pull_request:
44
types: [opened, edited, synchronize, reopened]
5+
env:
6+
GO_VERSION: 1.18
57
jobs:
68
golangci:
79
name: lint
@@ -16,9 +18,9 @@ jobs:
1618
- uses: actions/checkout@v3
1719
- uses: actions/setup-go@v3
1820
with:
19-
go-version: 1.17
21+
go-version: ${{ env.GO_VERSION }}
2022
- name: golangci-lint
2123
uses: golangci/[email protected]
2224
with:
23-
version: v1.44.0
25+
version: v1.46.2
2426
working-directory: ${{matrix.working-directory}}

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ linters-settings:
142142
allow-leading-space: false
143143
require-specific: true
144144
staticcheck:
145-
go: "1.17"
145+
go: "1.18"
146146
stylecheck:
147-
go: "1.17"
147+
go: "1.18"
148148
gosec:
149149
excludes:
150150
- G307 # Deferring unsafe method "Close" on type "\*os.File"
@@ -167,7 +167,7 @@ linters-settings:
167167
- whyNoLint
168168
- wrapperFunc
169169
unused:
170-
go: "1.17"
170+
go: "1.18"
171171
issues:
172172
max-same-issues: 0
173173
max-issues-per-linter: 0

controllers/remote/cluster_cache_reconciler_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestClusterCacheReconciler(t *testing.T) {
4545

4646
// createAndWatchCluster creates a new cluster and ensures the clusterCacheTracker has a clusterAccessor for it
4747
createAndWatchCluster := func(clusterName string, testNamespace *corev1.Namespace, g *WithT) {
48-
t.Log(fmt.Sprintf("Creating a cluster %q", clusterName))
48+
t.Logf("Creating a cluster %q", clusterName)
4949
testCluster := &clusterv1.Cluster{
5050
ObjectMeta: metav1.ObjectMeta{
5151
Name: clusterName,
@@ -136,7 +136,7 @@ func TestClusterCacheReconciler(t *testing.T) {
136136
defer teardown(t, g, testNamespace)
137137

138138
for _, clusterName := range []string{"cluster-1", "cluster-2", "cluster-3"} {
139-
t.Log(fmt.Sprintf("Deleting cluster %q", clusterName))
139+
t.Logf("Deleting cluster %q", clusterName)
140140
obj := &clusterv1.Cluster{
141141
ObjectMeta: metav1.ObjectMeta{
142142
Namespace: testNamespace.Name,
@@ -145,7 +145,7 @@ func TestClusterCacheReconciler(t *testing.T) {
145145
}
146146
g.Expect(k8sClient.Delete(ctx, obj)).To(Succeed())
147147

148-
t.Log(fmt.Sprintf("Checking cluster %q's clusterAccessor is removed", clusterName))
148+
t.Logf("Checking cluster %q's clusterAccessor is removed", clusterName)
149149
g.Eventually(func() bool { return cct.clusterAccessorExists(util.ObjectKey(obj)) }, timeout).Should(BeFalse())
150150
}
151151
})

util/container/image.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ limitations under the License.
1818
package container
1919

2020
import (
21-
2221
// Import the crypto sha256 algorithm for the docker image parser to work
2322
_ "crypto/sha256"
24-
2523
// Import the crypto/sha512 algorithm for the docker image parser to work with 384 and 512 sha hashes
2624
_ "crypto/sha512"
2725
"fmt"

0 commit comments

Comments
 (0)