Skip to content

Commit 6e7a20d

Browse files
authored
Update to Go 1.22 and latest Go dependencies (#854)
* Update to Go 1.22 Signed-off-by: Marvin Beckers <[email protected]> * Update k8s.io dependencies to v1.29 or latest versions Signed-off-by: Marvin Beckers <[email protected]> * Update spf13/cobra to v1.8.0 Signed-off-by: Marvin Beckers <[email protected]> * Update to golangci-lint v1.57.2 Signed-off-by: Marvin Beckers <[email protected]> * fix linter complaints surfaced by new linter versions Signed-off-by: Marvin Beckers <[email protected]> --------- Signed-off-by: Marvin Beckers <[email protected]>
1 parent efaaa22 commit 6e7a20d

File tree

14 files changed

+58
-56
lines changed

14 files changed

+58
-56
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go ${{ matrix.goVer }}
1919
uses: actions/setup-go@v3
2020
with:
21-
go-version: '1.20'
21+
go-version: '1.22'
2222
id: go
2323

2424
- name: Check out code into the Go module directory

.golangci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,19 @@ linters-settings:
2828

2929
# options for analysis running
3030
run:
31+
# include test files
32+
tests: true
33+
34+
issues:
3135
# which dirs to skip: they won't be analyzed;
3236
# can use regexp here: generated.*, regexp is applied on full path;
3337
# default value is empty list, but next dirs are always skipped independently
3438
# from this option's value:
3539
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
36-
skip-dirs:
40+
exclude-dirs:
3741
- hack
3842
- docs
3943

40-
# include test files
41-
tests: true
42-
4344
linters:
4445
disable-all: true
4546
enable:

cmd/krew/cmd/info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var infoCmd = &cobra.Command{
3838
Long: `Show detailed information about an available plugin.`,
3939
Example: ` kubectl krew info PLUGIN
4040
kubectl krew info INDEX/PLUGIN`,
41-
RunE: func(cmd *cobra.Command, args []string) error {
41+
RunE: func(_ *cobra.Command, args []string) error {
4242
index, plugin := pathutil.CanonicalPluginName(args[0])
4343

4444
p, err := indexscanner.LoadPluginByName(paths.IndexPluginsPath(index), plugin)

cmd/krew/cmd/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Remarks:
4040
the names of the plugins installed. This output can be piped back to the
4141
"install" command.`,
4242
Aliases: []string{"ls"},
43-
RunE: func(cmd *cobra.Command, args []string) error {
43+
RunE: func(_ *cobra.Command, _ []string) error {
4444
receipts, err := installation.GetInstalledPluginReceipts(paths.InstallReceiptsPath())
4545
if err != nil {
4646
return errors.Wrap(err, "failed to find all installed versions")

cmd/krew/cmd/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Examples:
6666
6767
To fuzzy search plugins with a keyword:
6868
kubectl krew search KEYWORD`,
69-
RunE: func(cmd *cobra.Command, args []string) error {
69+
RunE: func(_ *cobra.Command, args []string) error {
7070
indexes, err := indexoperations.ListIndexes(paths)
7171
if err != nil {
7272
return errors.Wrap(err, "failed to list indexes")

cmd/krew/cmd/uninstall.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Example:
3737
3838
Remarks:
3939
Failure to uninstall a plugin will result in an error and exit immediately.`,
40-
RunE: func(cmd *cobra.Command, args []string) error {
40+
RunE: func(_ *cobra.Command, args []string) error {
4141
for _, name := range args {
4242
if isCanonicalName(name) {
4343
return errors.New("uninstall command does not support INDEX/PLUGIN syntax; just specify PLUGIN")

cmd/krew/cmd/upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This will reinstall all plugins that have a newer version in the local index.
4343
Use "kubectl krew update" to renew the index.
4444
To only upgrade single plugins provide them as arguments:
4545
kubectl krew upgrade foo bar"`,
46-
RunE: func(cmd *cobra.Command, args []string) error {
46+
RunE: func(_ *cobra.Command, args []string) error {
4747
var ignoreUpgraded bool
4848
var skipErrors bool
4949

cmd/krew/cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Remarks:
3939
- IndexPath is the directory that stores the local copy of the index git repository.
4040
- InstallPath is the directory for plugin installations.
4141
- BinPath is the directory for the symbolic links to the installed plugin executables.`,
42-
RunE: func(cmd *cobra.Command, args []string) error {
42+
RunE: func(_ *cobra.Command, _ []string) error {
4343
conf := [][]string{
4444
{"GitTag", version.GitTag()},
4545
{"GitCommit", version.GitCommit()},

cmd/validate-krew-manifest/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ var licenseFiles = map[string]struct{}{
182182
func validateLicenseFileExists(krewRoot string) error {
183183
dir := environment.NewPaths(krewRoot).InstallPath()
184184
var files []string
185-
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
185+
err := filepath.Walk(dir, func(_ string, info os.FileInfo, err error) error {
186186
if err != nil {
187187
return err
188188
}

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
module sigs.k8s.io/krew
22

3-
go 1.20
3+
go 1.22
44

55
require (
66
github.com/fatih/color v1.15.0
7-
github.com/google/go-cmp v0.5.9
7+
github.com/google/go-cmp v0.6.0
88
github.com/mattn/go-isatty v0.0.19
99
github.com/pkg/errors v0.9.1
1010
github.com/sahilm/fuzzy v0.1.0
11-
github.com/spf13/cobra v1.7.0
11+
github.com/spf13/cobra v1.8.0
1212
github.com/spf13/pflag v1.0.5
13-
k8s.io/apimachinery v0.27.3
14-
k8s.io/client-go v11.0.0+incompatible
15-
k8s.io/klog/v2 v2.100.1
16-
sigs.k8s.io/yaml v1.3.0
13+
k8s.io/apimachinery v0.29.3
14+
k8s.io/client-go v0.29.3
15+
k8s.io/klog/v2 v2.120.1
16+
sigs.k8s.io/yaml v1.4.0
1717
)
1818

1919
require (
20-
github.com/go-logr/logr v1.2.4 // indirect
20+
github.com/go-logr/logr v1.4.1 // indirect
2121
github.com/gogo/protobuf v1.3.2 // indirect
2222
github.com/google/gofuzz v1.2.0 // indirect
2323
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -26,12 +26,12 @@ require (
2626
github.com/mattn/go-colorable v0.1.13 // indirect
2727
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2828
github.com/modern-go/reflect2 v1.0.2 // indirect
29-
golang.org/x/net v0.12.0 // indirect
30-
golang.org/x/sys v0.10.0 // indirect
31-
golang.org/x/text v0.11.0 // indirect
29+
golang.org/x/net v0.19.0 // indirect
30+
golang.org/x/sys v0.15.0 // indirect
31+
golang.org/x/text v0.14.0 // indirect
3232
gopkg.in/inf.v0 v0.9.1 // indirect
3333
gopkg.in/yaml.v2 v2.4.0 // indirect
34-
k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect
34+
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
3535
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
36-
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
36+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
3737
)

0 commit comments

Comments
 (0)