From 6ceb1acfa6dc39493c544e0e6127bf8d7d9c02ec Mon Sep 17 00:00:00 2001 From: Miguel Molina Date: Tue, 10 Sep 2024 14:08:18 -0400 Subject: [PATCH] housekeeping: update to go 1.23 (#3114) ### Description PR changes - updates go version to 1.23 - updates golangci - fixes failing test ### Testing Performed `make` `make backend-lint` `make backend-dev` --- .github/workflows/api.yml | 4 ++-- .github/workflows/backend.yml | 8 ++++---- .github/workflows/frontend.yml | 2 +- .github/workflows/license_review.yml | 2 +- .github/workflows/scaffolding.yml | 2 +- backend/go.mod | 4 +--- backend/module/audit/audit_test.go | 2 +- backend/module/feedback/feedback.go | 2 +- .../chaos/experimentation/terminator/terminator_test.go | 2 +- backend/service/github/github.go | 2 +- docs/_website/generator/go.mod | 2 +- tools/go.mod | 2 +- tools/golangci-lint.sh | 6 +++--- tools/scaffolding/templates/gateway/backend/go.mod.tmpl | 2 +- 14 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 72621e2b7b..ae7f107ffc 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.22.x + go-version: 1.23.x - name: Set up Node uses: actions/setup-node@v3 with: @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.22.x + go-version: 1.23.x - name: lint run: make api-lint diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index e773da30c1..d4628eedb0 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - name: go mod cache uses: actions/cache@v4 with: @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - name: go mod cache uses: actions/cache@v4 with: @@ -72,7 +72,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - run: make backend-integration-test lint: runs-on: ubuntu-latest @@ -81,7 +81,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - name: go mod cache uses: actions/cache@v4 with: diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 28cb99b45b..12f405123c 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -94,7 +94,7 @@ jobs: - uses: actions/setup-go@v4 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - uses: actions/setup-node@v4 with: node-version: "18.x" diff --git a/.github/workflows/license_review.yml b/.github/workflows/license_review.yml index cf70210830..7e3e0850e4 100644 --- a/.github/workflows/license_review.yml +++ b/.github/workflows/license_review.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-go@v3 id: setup-go with: - go-version: 1.22.x + go-version: 1.23.x - name: Install Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/scaffolding.yml b/.github/workflows/scaffolding.yml index 0bf4cfd9f6..a49bdde942 100644 --- a/.github/workflows/scaffolding.yml +++ b/.github/workflows/scaffolding.yml @@ -18,7 +18,7 @@ jobs: path: ${{ env.PACKAGEPATH }} - uses: actions/setup-go@v3 with: - go-version: 1.22.x + go-version: 1.23.x - uses: actions/setup-node@v3 with: node-version: '18.x' diff --git a/backend/go.mod b/backend/go.mod index acd9edd5e0..304a567369 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -1,8 +1,6 @@ module github.com/lyft/clutch/backend -go 1.22.0 - -toolchain go1.22.3 +go 1.23.0 require ( github.com/DATA-DOG/go-sqlmock v1.5.0 diff --git a/backend/module/audit/audit_test.go b/backend/module/audit/audit_test.go index 2e54bd1772..52ad18be12 100644 --- a/backend/module/audit/audit_test.go +++ b/backend/module/audit/audit_test.go @@ -152,7 +152,7 @@ func TestGetEvents(t *testing.T) { for _, test := range testCases { test := test - t.Run(fmt.Sprintf(test.id), func(t *testing.T) { + t.Run(test.id, func(t *testing.T) { t.Parallel() m := &mod{ client: auditmock.New(), diff --git a/backend/module/feedback/feedback.go b/backend/module/feedback/feedback.go index 605fca6a7f..9fc7843399 100644 --- a/backend/module/feedback/feedback.go +++ b/backend/module/feedback/feedback.go @@ -103,7 +103,7 @@ func (m *mod) GetSurveys(tx context.Context, req *feedbackv1.GetSurveysRequest) zap.Any("request origins", req.Origins), zap.Any("config origins", m.surveyMap.surveys), ) - return nil, status.Errorf(codes.InvalidArgument, msg) + return nil, status.Errorf(codes.InvalidArgument, "%s", msg) } return &feedbackv1.GetSurveysResponse{ diff --git a/backend/service/chaos/experimentation/terminator/terminator_test.go b/backend/service/chaos/experimentation/terminator/terminator_test.go index fbfb6ef910..ff5952e5af 100644 --- a/backend/service/chaos/experimentation/terminator/terminator_test.go +++ b/backend/service/chaos/experimentation/terminator/terminator_test.go @@ -186,7 +186,7 @@ func awaitGaugeValue(ctx context.Context, t *testing.T, testScope tally.TestScop return } case <-ctx.Done(): - t.Errorf(context.Canceled.Error()) + t.Errorf("%s", context.Canceled.Error()) return } } diff --git a/backend/service/github/github.go b/backend/service/github/github.go index c0af90109b..98384f2bda 100644 --- a/backend/service/github/github.go +++ b/backend/service/github/github.go @@ -531,7 +531,7 @@ func (s *svc) GetCommit(ctx context.Context, ref *RemoteRef) (*Commit, error) { Author: commit.GetAuthor(), } - if commit.Parents != nil && len(commit.Parents) > 0 { + if len(commit.Parents) > 0 { retCommit.ParentRef = commit.Parents[0].GetSHA() } diff --git a/docs/_website/generator/go.mod b/docs/_website/generator/go.mod index b90a86f66c..f39dd2a2c5 100644 --- a/docs/_website/generator/go.mod +++ b/docs/_website/generator/go.mod @@ -1,6 +1,6 @@ module github.com/lyft/clutch/docs/website/generator -go 1.22 +go 1.23 require ( github.com/Masterminds/sprig/v3 v3.2.3 diff --git a/tools/go.mod b/tools/go.mod index 16edaa9b88..8b17795773 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,3 +1,3 @@ module github.com/lyft/clutch/tools -go 1.22 +go 1.23 diff --git a/tools/golangci-lint.sh b/tools/golangci-lint.sh index 17b2318118..437eeda687 100755 --- a/tools/golangci-lint.sh +++ b/tools/golangci-lint.sh @@ -6,9 +6,9 @@ BUILD_ROOT="${REPO_ROOT}/build" BUILD_BIN="${BUILD_ROOT}/bin" NAME=golangci-lint -RELEASE=v1.56.1 -OSX_RELEASE_256=62f02d4c0e8f6f8c77e787b8f271cdd1535eb7d2a28742e2535608652271018e -LINUX_RELEASE_256=aaf8260c76530f7571c49a7bc34b2ecd15accac21106710d47463a2313f1f663 +RELEASE=v1.60.1 +OSX_RELEASE_256=a0ec2235b5cc7aad6e1ee009efd5bec7c16bf2f01246c6ccb1df5c37bb2f5cd4 +LINUX_RELEASE_256=06a803675ec83944d8c9e5a8dfa32845270cc447e7ebe0173c4b8ba7e205c9da ARCH=amd64 diff --git a/tools/scaffolding/templates/gateway/backend/go.mod.tmpl b/tools/scaffolding/templates/gateway/backend/go.mod.tmpl index 694faab105..1216fd41af 100644 --- a/tools/scaffolding/templates/gateway/backend/go.mod.tmpl +++ b/tools/scaffolding/templates/gateway/backend/go.mod.tmpl @@ -1,3 +1,3 @@ module {{ .RepoProvider }}/{{ .RepoOwner }}/{{ .RepoName }}/backend -go 1.22 +go 1.23