Skip to content

Commit

Permalink
chore: bump to use go 1.23.0 (#2101)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
chenrui333 authored Aug 17, 2024
1 parent 01b2a57 commit 49b2851
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Run linters
uses: golangci/[email protected]
with:
version: v1.58
version: v1.60.1
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 as builder
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 as builder

ARG TARGETOS TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion cmd/inspect_parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (cli *CLI) inspectParallel(opts Options) int {
}
if worker.err != nil {
// If the worker is canceled, suppress the error message.
if errors.Is(context.Canceled, worker.err) {
if errors.Is(worker.err, context.Canceled) {
canceled = true
continue
}
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/building.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building TFLint

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.
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.

```console
$ git clone https://github.com/terraform-linters/tflint.git
Expand Down
6 changes: 3 additions & 3 deletions formatter/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ failed
formatter.PrintErrorParallel(test.err, map[string][]byte{})

if diff := cmp.Diff(test.stderr, stderr.String()); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}
})
}
Expand Down Expand Up @@ -162,10 +162,10 @@ Reference: https://github.com
}

if diff := cmp.Diff(test.stdout, stdout.String()); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}
if diff := cmp.Diff(test.stderr, stderr.String()); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/terraform-linters/tflint

go 1.22.5
go 1.23.0

require (
github.com/agext/levenshtein v1.2.3
Expand Down
2 changes: 1 addition & 1 deletion plugin/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ resource "aws_instance" "foo" {

got := server.GetFiles(sdk.SelfModuleCtxType)
if diff := cmp.Diff(test.want, got); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion terraform/lang/function_calls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func TestFunctionCallsInExpr(t *testing.T) {
}

if diff := cmp.Diff(test.want, got); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}
})
}
Expand Down
10 changes: 5 additions & 5 deletions terraform/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func TestLoadConfigDir(t *testing.T) {
primariesWant[i] = f.Body.MissingItemRange().Filename
}
if diff := cmp.Diff(primaries, primariesWant); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}

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

if diff := cmp.Diff(mod.Sources, test.want.Sources); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}

files := []string{}
Expand All @@ -230,7 +230,7 @@ func TestLoadConfigDir(t *testing.T) {
}
opt := cmpopts.SortSlices(func(x, y string) bool { return x > y })
if diff := cmp.Diff(files, filesWant, opt); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}
})
}
Expand Down Expand Up @@ -343,7 +343,7 @@ func TestLoadConfigDirFiles(t *testing.T) {
got = append(got, name)
}
if diff := cmp.Diff(got, test.want, opt); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion tflint/annotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ resource "aws_instance" "foo" {

opts := cmpopts.IgnoreFields(hcl.Pos{}, "Byte")
if diff := cmp.Diff(test.want, got, opts); diff != "" {
t.Errorf(diff)
t.Errorf("diff: %s", diff)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion tflint/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ func Test_EmitIssue(t *testing.T) {
}

if diff := cmp.Diff(runner.Issues.Sort(), tc.Expected); diff != "" {
t.Fatalf(diff)
t.Fatalf("diff: %s", diff)
}
})
}
Expand Down

0 comments on commit 49b2851

Please sign in to comment.