Skip to content

Commit 65594a1

Browse files
build(deps): bump golang from 1.22.5 to 1.23.0 (#1140)
* build(deps): bump golang from 1.22.5 to 1.23.0 Bumps golang from 1.22.5 to 1.23.0. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Update golangci-lint * Remove depguard linter as we do not have that configured * Remove deprecated megacheck linter * Fix linting issues * Fix more linting issues * More linting fixes * Fix more linting issues * Update testcase for error message check --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Horst Gutmann <[email protected]>
1 parent d69d2f2 commit 65594a1

16 files changed

+34
-36
lines changed

.golangci.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
linters:
22
enable:
3-
- depguard
43
- dogsled
54
- errcheck
6-
- exportloopref
5+
- copyloopvar
76
- goconst
87
- gocritic
98
- gofmt
109
- goimports
1110
- gosimple
1211
- govet
1312
- ineffassign
14-
- megacheck
1513
- misspell
1614
- revive
1715
- staticcheck

Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# download kubectl
2-
FROM golang:1.22.5-alpine AS kubectl
2+
FROM golang:1.23.0-alpine AS kubectl
33
RUN apk add --no-cache curl
44
RUN export VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) &&\
55
export OS=$(go env GOOS) && \
@@ -8,7 +8,7 @@ RUN export VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/r
88
chmod +x /usr/local/bin/kubectl
99

1010
# build jsonnet-bundler
11-
FROM golang:1.22.5-alpine AS jb
11+
FROM golang:1.23.0-alpine AS jb
1212
WORKDIR /tmp
1313
RUN apk add --no-cache git make bash &&\
1414
git clone https://github.com/jsonnet-bundler/jsonnet-bundler &&\
@@ -17,7 +17,7 @@ RUN apk add --no-cache git make bash &&\
1717
make static &&\
1818
mv _output/jb /usr/local/bin/jb
1919

20-
FROM golang:1.22.5-alpine AS helm
20+
FROM golang:1.23.0-alpine AS helm
2121
WORKDIR /tmp/helm
2222
RUN apk add --no-cache jq curl
2323
RUN export TAG=$(curl --silent "https://api.github.com/repos/helm/helm/releases/latest" | jq -r .tag_name) &&\
@@ -26,7 +26,7 @@ RUN export TAG=$(curl --silent "https://api.github.com/repos/helm/helm/releases/
2626
curl -SL "https://get.helm.sh/helm-${TAG}-${OS}-${ARCH}.tar.gz" > helm.tgz && \
2727
tar -xvf helm.tgz --strip-components=1
2828

29-
FROM golang:1.22.5-alpine AS kustomize
29+
FROM golang:1.23.0-alpine AS kustomize
3030
WORKDIR /tmp/kustomize
3131
RUN apk add --no-cache jq curl
3232
# Get the latest version of kustomize
@@ -39,7 +39,7 @@ RUN export TAG=$(curl --silent "https://api.github.com/repos/kubernetes-sigs/kus
3939
curl -SL "https://github.com/kubernetes-sigs/kustomize/releases/download/${TAG}/kustomize_${VERSION_TAG}_${OS}_${ARCH}.tar.gz" > kustomize.tgz && \
4040
tar -xvf kustomize.tgz
4141

42-
FROM golang:1.22.5 AS build
42+
FROM golang:1.23.0 AS build
4343
WORKDIR /app
4444
COPY . .
4545
RUN make static

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GOX := $(BIN_DIR)/gox
66
GOLINTER := $(GOPATH)/bin/golangci-lint
77

88
$(GOLINTER):
9-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
9+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
1010

1111
lint: $(GOLINTER)
1212
$(GOLINTER) run

cmd/tk/env.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func envRemoveCmd() *cli.Command {
206206
Aliases: []string{"rm"},
207207
Short: "delete an environment",
208208
Args: workflowArgs,
209-
Run: func(cmd *cli.Command, args []string) error {
209+
Run: func(_ *cli.Command, args []string) error {
210210
for _, arg := range args {
211211
path, err := filepath.Abs(arg)
212212
if err != nil {
@@ -243,7 +243,7 @@ func envListCmd() *cli.Command {
243243

244244
getJsonnetOpts := jsonnetFlags(cmd.Flags())
245245

246-
cmd.Run = func(cmd *cli.Command, args []string) error {
246+
cmd.Run = func(_ *cli.Command, args []string) error {
247247
var path string
248248
var err error
249249
if len(args) == 1 {

cmd/tk/export.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func exportCmd() *cli.Command {
4848

4949
recursive := cmd.Flags().BoolP("recursive", "r", false, "Look recursively for Tanka environments")
5050

51-
cmd.Run = func(cmd *cli.Command, args []string) error {
51+
cmd.Run = func(_ *cli.Command, args []string) error {
5252
// Allocate a block of memory to alter GC behaviour. See https://github.com/golang/go/issues/23044
5353
ballast := make([]byte, *ballastBytes)
5454
defer runtime.KeepAlive(ballast)

cmd/tk/fmt.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func fmtCmd() *cli.Command {
3030
exclude := cmd.Flags().StringSliceP("exclude", "e", []string{"**/.*", ".*", "**/vendor/**", "vendor/**"}, "globs to exclude")
3131
verbose := cmd.Flags().BoolP("verbose", "v", false, "print each checked file")
3232

33-
cmd.Run = func(cmd *cli.Command, args []string) error {
33+
cmd.Run = func(_ *cli.Command, args []string) error {
3434
if len(args) == 1 && args[0] == ArgStdin {
3535
return fmtStdin(*test)
3636
}
@@ -47,7 +47,7 @@ func fmtCmd() *cli.Command {
4747
var outFn tanka.OutFn
4848
switch {
4949
case *test:
50-
outFn = func(name, content string) error { return nil }
50+
outFn = func(_, _ string) error { return nil }
5151
case *stdout:
5252
outFn = func(name, content string) error {
5353
fmt.Printf("// %s\n%s", name, content)

cmd/tk/init.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func initCmd() *cli.Command {
2626
installK8s := cmd.Flags().String("k8s", defaultK8sVersion, "choose the version of k8s-libsonnet, set to false to skip")
2727
inline := cmd.Flags().BoolP("inline", "i", false, "create an inline environment")
2828

29-
cmd.Run = func(cmd *cli.Command, args []string) error {
29+
cmd.Run = func(_ *cli.Command, _ []string) error {
3030
failed := false
3131

3232
files, err := os.ReadDir(".")

cmd/tk/jsonnet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func evalCmd() *cli.Command {
2020

2121
getJsonnetOpts := jsonnetFlags(cmd.Flags())
2222

23-
cmd.Run = func(cmd *cli.Command, args []string) error {
23+
cmd.Run = func(_ *cli.Command, args []string) error {
2424
jsonnetOpts := tanka.Opts{
2525
JsonnetImplementation: *jsonnetImplementation,
2626
JsonnetOpts: getJsonnetOpts(),

cmd/tk/lint.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func lintCmd() *cli.Command {
2727
panic(err)
2828
}
2929

30-
cmd.Run = func(cmd *cli.Command, args []string) error {
30+
cmd.Run = func(_ *cli.Command, args []string) error {
3131
globs := make([]glob.Glob, len(*exclude))
3232
for i, e := range *exclude {
3333
g, err := glob.Compile(e)

cmd/tk/prefix.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func prefixCommands(prefix string) (cmds []*cli.Command) {
3131
extCommand.Stdout = os.Stdout
3232
extCommand.Stderr = os.Stderr
3333

34-
cmd.Run = func(cmd *cli.Command, args []string) error {
34+
cmd.Run = func(_ *cli.Command, args []string) error {
3535
extCommand.Args = append(extCommand.Args, args...)
3636
return extCommand.Run()
3737
}

cmd/tk/status.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func statusCmd() *cli.Command {
2323
vars := workflowFlags(cmd.Flags())
2424
getJsonnetOpts := jsonnetFlags(cmd.Flags())
2525

26-
cmd.Run = func(cmd *cli.Command, args []string) error {
26+
cmd.Run = func(_ *cli.Command, args []string) error {
2727
status, err := tanka.Status(args[0], tanka.Opts{
2828
JsonnetImplementation: vars.jsonnetImplementation,
2929
JsonnetOpts: getJsonnetOpts(),

cmd/tk/tool.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func jpathCmd() *cli.Command {
4242

4343
debug := cmd.Flags().BoolP("debug", "d", false, "show debug info")
4444

45-
cmd.Run = func(cmd *cli.Command, args []string) error {
45+
cmd.Run = func(_ *cli.Command, args []string) error {
4646
path := args[0]
4747

4848
entrypoint, err := jpath.Entrypoint(path)
@@ -81,7 +81,7 @@ func importsCmd() *cli.Command {
8181

8282
check := cmd.Flags().StringP("check", "c", "", "git commit hash to check against")
8383

84-
cmd.Run = func(cmd *cli.Command, args []string) error {
84+
cmd.Run = func(_ *cli.Command, args []string) error {
8585
var modFiles []string
8686
if *check != "" {
8787
var err error
@@ -156,7 +156,7 @@ if the file is not a vendored (located at <tk-root>/vendor/) or a lib file (loca
156156
}
157157

158158
root := cmd.Flags().String("root", ".", "root directory to search for environments")
159-
cmd.Run = func(cmd *cli.Command, args []string) error {
159+
cmd.Run = func(_ *cli.Command, args []string) error {
160160
root, err := filepath.Abs(*root)
161161
if err != nil {
162162
return fmt.Errorf("resolving root: %w", err)

cmd/tk/toolCharts.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func chartsVendorCmd() *cli.Command {
4141
prune := cmd.Flags().Bool("prune", false, "also remove non-vendored files from the destination directory")
4242
repoConfigPath := cmd.Flags().String("repository-config", "", repoConfigFlagUsage)
4343

44-
cmd.Run = func(cmd *cli.Command, args []string) error {
44+
cmd.Run = func(_ *cli.Command, _ []string) error {
4545
c, err := loadChartfile()
4646
if err != nil {
4747
return err
@@ -60,7 +60,7 @@ func chartsAddCmd() *cli.Command {
6060
}
6161
repoConfigPath := cmd.Flags().String("repository-config", "", repoConfigFlagUsage)
6262

63-
cmd.Run = func(cmd *cli.Command, args []string) error {
63+
cmd.Run = func(_ *cli.Command, args []string) error {
6464
c, err := loadChartfile()
6565
if err != nil {
6666
return err
@@ -79,7 +79,7 @@ func chartsAddRepoCmd() *cli.Command {
7979
Args: cli.ArgsExact(2),
8080
}
8181

82-
cmd.Run = func(cmd *cli.Command, args []string) error {
82+
cmd.Run = func(_ *cli.Command, args []string) error {
8383
c, err := loadChartfile()
8484
if err != nil {
8585
return err
@@ -100,7 +100,7 @@ func chartsConfigCmd() *cli.Command {
100100
Short: "Displays the current manifest",
101101
}
102102

103-
cmd.Run = func(cmd *cli.Command, args []string) error {
103+
cmd.Run = func(_ *cli.Command, _ []string) error {
104104
c, err := loadChartfile()
105105
if err != nil {
106106
return err
@@ -125,7 +125,7 @@ func chartsInitCmd() *cli.Command {
125125
Short: "Create a new Chartfile",
126126
}
127127

128-
cmd.Run = func(cmd *cli.Command, args []string) error {
128+
cmd.Run = func(_ *cli.Command, _ []string) error {
129129
wd, err := os.Getwd()
130130
if err != nil {
131131
return err
@@ -155,7 +155,7 @@ func chartsVersionCheckCmd() *cli.Command {
155155
repoConfigPath := cmd.Flags().String("repository-config", "", repoConfigFlagUsage)
156156
prettyPrint := cmd.Flags().Bool("pretty-print", false, "pretty print json output with indents")
157157

158-
cmd.Run = func(cmd *cli.Command, args []string) error {
158+
cmd.Run = func(_ *cli.Command, _ []string) error {
159159
c, err := loadChartfile()
160160
if err != nil {
161161
return err

cmd/tk/workflow.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func applyCmd() *cli.Command {
9595
vars := workflowFlags(cmd.Flags())
9696
getJsonnetOpts := jsonnetFlags(cmd.Flags())
9797

98-
cmd.Run = func(cmd *cli.Command, args []string) error {
98+
cmd.Run = func(_ *cli.Command, args []string) error {
9999
err := validateDryRun(opts.DryRun)
100100
if err != nil {
101101
return err
@@ -141,7 +141,7 @@ func pruneCmd() *cli.Command {
141141
addDiffFlags(cmd.Flags(), &opts.DiffBaseOpts)
142142
getJsonnetOpts := jsonnetFlags(cmd.Flags())
143143

144-
cmd.Run = func(cmd *cli.Command, args []string) error {
144+
cmd.Run = func(_ *cli.Command, args []string) error {
145145
err := validateDryRun(opts.DryRun)
146146
if err != nil {
147147
return err
@@ -182,7 +182,7 @@ func deleteCmd() *cli.Command {
182182
vars := workflowFlags(cmd.Flags())
183183
getJsonnetOpts := jsonnetFlags(cmd.Flags())
184184

185-
cmd.Run = func(cmd *cli.Command, args []string) error {
185+
cmd.Run = func(_ *cli.Command, args []string) error {
186186
err := validateDryRun(opts.DryRun)
187187
if err != nil {
188188
return err
@@ -229,7 +229,7 @@ func diffCmd() *cli.Command {
229229
vars := workflowFlags(cmd.Flags())
230230
getJsonnetOpts := jsonnetFlags(cmd.Flags())
231231

232-
cmd.Run = func(cmd *cli.Command, args []string) error {
232+
cmd.Run = func(_ *cli.Command, args []string) error {
233233
if err := setForceColor(&opts.DiffBaseOpts); err != nil {
234234
return err
235235
}
@@ -280,7 +280,7 @@ func showCmd() *cli.Command {
280280
vars := workflowFlags(cmd.Flags())
281281
getJsonnetOpts := jsonnetFlags(cmd.Flags())
282282

283-
cmd.Run = func(cmd *cli.Command, args []string) error {
283+
cmd.Run = func(_ *cli.Command, args []string) error {
284284
if !interactive && !*allowRedirect {
285285
fmt.Fprintln(os.Stderr, `Redirection of the output of tk show is discouraged and disabled by default.
286286
If you want to export .yaml files for use with other tools, try 'tk export'.

pkg/helm/charts_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func TestAdd(t *testing.T) {
9797

9898
// Adding a chart with a different version to the same path, causes a conflict
9999
err = c.Add([]string{"stable/[email protected]"}, "")
100-
assert.EqualError(t, err, `Validation errors:
100+
assert.EqualError(t, err, `validation errors:
101101
- output directory "prometheus" is used twice, by charts "stable/[email protected]" and "stable/[email protected]"`)
102102

103103
// Add a chart with a specific extract directory
@@ -241,7 +241,7 @@ func TestInvalidChartName(t *testing.T) {
241241
})
242242

243243
err = c.Vendor(false, "")
244-
assert.EqualError(t, err, `Validation errors:
244+
assert.EqualError(t, err, `validation errors:
245245
- Chart name "noslash" is not valid. Expecting a repo/name format.`)
246246
}
247247

pkg/helm/spec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (r Requirements) Validate() error {
132132
}
133133

134134
if len(errs) > 0 {
135-
return fmt.Errorf("Validation errors:\n - " + strings.Join(errs, "\n - "))
135+
return fmt.Errorf("validation errors:\n - %s", strings.Join(errs, "\n - "))
136136
}
137137

138138
return nil

0 commit comments

Comments
 (0)