Skip to content

Commit 49b2851

Browse files
authored
chore: bump to use go 1.23.0 (#2101)
* chore: bump to use go 1.23.0 Signed-off-by: Rui Chen <[email protected]> * bump golangci-lint to the latest (built with go1.23) * fix govet lint failures * fix args wrong order lint failure --------- Signed-off-by: Rui Chen <[email protected]>
1 parent 01b2a57 commit 49b2851

File tree

11 files changed

+17
-17
lines changed

11 files changed

+17
-17
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
- name: Run linters
2626
uses: golangci/[email protected]
2727
with:
28-
version: v1.58
28+
version: v1.60.1

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 as builder
1+
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 as builder
22

33
ARG TARGETOS TARGETARCH
44

cmd/inspect_parallel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (cli *CLI) inspectParallel(opts Options) int {
5858
}
5959
if worker.err != nil {
6060
// If the worker is canceled, suppress the error message.
61-
if errors.Is(context.Canceled, worker.err) {
61+
if errors.Is(worker.err, context.Canceled) {
6262
canceled = true
6363
continue
6464
}

docs/developer-guide/building.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Building TFLint
22

3-
Go 1.22 or higher is required to build TFLint from source code. Clone the source code and run the `make` command. Built binary will be placed in `dist` directory.
3+
Go 1.23 or higher is required to build TFLint from source code. Clone the source code and run the `make` command. Built binary will be placed in `dist` directory.
44

55
```console
66
$ git clone https://github.com/terraform-linters/tflint.git

formatter/formatter_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ failed
6969
formatter.PrintErrorParallel(test.err, map[string][]byte{})
7070

7171
if diff := cmp.Diff(test.stderr, stderr.String()); diff != "" {
72-
t.Errorf(diff)
72+
t.Errorf("diff: %s", diff)
7373
}
7474
})
7575
}
@@ -162,10 +162,10 @@ Reference: https://github.com
162162
}
163163

164164
if diff := cmp.Diff(test.stdout, stdout.String()); diff != "" {
165-
t.Errorf(diff)
165+
t.Errorf("diff: %s", diff)
166166
}
167167
if diff := cmp.Diff(test.stderr, stderr.String()); diff != "" {
168-
t.Errorf(diff)
168+
t.Errorf("diff: %s", diff)
169169
}
170170
})
171171
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/terraform-linters/tflint
22

3-
go 1.22.5
3+
go 1.23.0
44

55
require (
66
github.com/agext/levenshtein v1.2.3

plugin/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ resource "aws_instance" "foo" {
768768

769769
got := server.GetFiles(sdk.SelfModuleCtxType)
770770
if diff := cmp.Diff(test.want, got); diff != "" {
771-
t.Errorf(diff)
771+
t.Errorf("diff: %s", diff)
772772
}
773773
})
774774
}

terraform/lang/function_calls_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func TestFunctionCallsInExpr(t *testing.T) {
116116
}
117117

118118
if diff := cmp.Diff(test.want, got); diff != "" {
119-
t.Errorf(diff)
119+
t.Errorf("diff: %s", diff)
120120
}
121121
})
122122
}

terraform/parser_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func TestLoadConfigDir(t *testing.T) {
201201
primariesWant[i] = f.Body.MissingItemRange().Filename
202202
}
203203
if diff := cmp.Diff(primaries, primariesWant); diff != "" {
204-
t.Errorf(diff)
204+
t.Errorf("diff: %s", diff)
205205
}
206206

207207
overrides := map[string]string{}
@@ -213,11 +213,11 @@ func TestLoadConfigDir(t *testing.T) {
213213
overridesWant[i] = f.Body.MissingItemRange().Filename
214214
}
215215
if diff := cmp.Diff(overrides, overridesWant); diff != "" {
216-
t.Errorf(diff)
216+
t.Errorf("diff: %s", diff)
217217
}
218218

219219
if diff := cmp.Diff(mod.Sources, test.want.Sources); diff != "" {
220-
t.Errorf(diff)
220+
t.Errorf("diff: %s", diff)
221221
}
222222

223223
files := []string{}
@@ -230,7 +230,7 @@ func TestLoadConfigDir(t *testing.T) {
230230
}
231231
opt := cmpopts.SortSlices(func(x, y string) bool { return x > y })
232232
if diff := cmp.Diff(files, filesWant, opt); diff != "" {
233-
t.Errorf(diff)
233+
t.Errorf("diff: %s", diff)
234234
}
235235
})
236236
}
@@ -343,7 +343,7 @@ func TestLoadConfigDirFiles(t *testing.T) {
343343
got = append(got, name)
344344
}
345345
if diff := cmp.Diff(got, test.want, opt); diff != "" {
346-
t.Errorf(diff)
346+
t.Errorf("diff: %s", diff)
347347
}
348348
})
349349
}

tflint/annotation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ resource "aws_instance" "foo" {
203203

204204
opts := cmpopts.IgnoreFields(hcl.Pos{}, "Byte")
205205
if diff := cmp.Diff(test.want, got, opts); diff != "" {
206-
t.Errorf(diff)
206+
t.Errorf("diff: %s", diff)
207207
}
208208
})
209209
}

0 commit comments

Comments
 (0)