From c5c6c11458d0169a5038561393eed6e397c0cbe0 Mon Sep 17 00:00:00 2001 From: Preston Locke Date: Thu, 31 Oct 2024 15:22:41 -0500 Subject: [PATCH 1/4] Various CI/linting updates --- .github/workflows/test.yml | 13 ++++++------- .golangci.yaml | 7 ++++--- go.mod | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb0ad3d..8efd5b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,15 +11,15 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.23 - name: Build run: go build -v ./... @@ -28,7 +28,6 @@ jobs: run: go test -v ./... - name: Lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v6 with: - version: v1.45.2 - only-new-issues: true + version: v1.61 diff --git a/.golangci.yaml b/.golangci.yaml index 9bd0bda..b3184ad 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -12,12 +12,13 @@ linters: - stylecheck - gosec - dupl - - maligned - depguard - lll - prealloc - - scopelint - gocritic - gochecknoinits - gochecknoglobals - - typecheck # Go 1.13 incompatible pending new golangci-lint binary release + # These are deprecated + - execinquery + - exportloopref + - gomnd diff --git a/go.mod b/go.mod index a07123b..730606d 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/letsencrypt/gorepotemplate -go 1.18 +go 1.23 From cff328e87db2f216da97c4abc71af5cd88e0108a Mon Sep 17 00:00:00 2001 From: Preston Locke Date: Thu, 31 Oct 2024 15:54:05 -0500 Subject: [PATCH 2/4] Disable some noisy linters --- .golangci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.golangci.yaml b/.golangci.yaml index b3184ad..1ad293e 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -18,6 +18,10 @@ linters: - gocritic - gochecknoinits - gochecknoglobals + - exhaustruct + - testpackage + - paralleltest + - nlreturn # These are deprecated - execinquery - exportloopref From ca15216e1494ce793c932fc39a3447c57eb80518 Mon Sep 17 00:00:00 2001 From: Preston Locke Date: Thu, 31 Oct 2024 16:09:14 -0500 Subject: [PATCH 3/4] Disable perfsprint linter --- .golangci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yaml b/.golangci.yaml index 1ad293e..b693fce 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -22,6 +22,7 @@ linters: - testpackage - paralleltest - nlreturn + - perfsprint # These are deprecated - execinquery - exportloopref From 2fbf1ef9e47b1e48c829d81299ff7bae6f1cf361 Mon Sep 17 00:00:00 2001 From: Preston Locke Date: Thu, 31 Oct 2024 16:31:54 -0500 Subject: [PATCH 4/4] OMG golangci-lint, PLEASE --- hello.go | 1 + 1 file changed, 1 insertion(+) diff --git a/hello.go b/hello.go index 3e9f9b2..3aa8155 100644 --- a/hello.go +++ b/hello.go @@ -14,5 +14,6 @@ func Hello(name string) string { if name == "" { return "Hello" } + return fmt.Sprintf("Hello %s", strings.ToLower(name)) }