From bd094e33b1f62689f4c74dbc965d6432ae948b7c Mon Sep 17 00:00:00 2001 From: Edward McFarlane <3036610+emcfarlane@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:18:38 -0400 Subject: [PATCH] Upgrade go to v1.22 (#71) Increase the min go v1.20 and the current to v1.122. Also bumps the Makefile deps for buf, license and linting. --- .github/workflows/ci.yaml | 8 ++++---- .golangci.yml | 4 +++- Makefile | 8 ++++---- client.go | 2 +- client_example_test.go | 2 +- client_test.go | 2 +- go.mod | 2 +- grpcreflect.go | 2 +- grpcreflect_test.go | 2 +- internal/gen/go/connect/reflecttest/v1/reflecttest.pb.go | 2 +- .../gen/go/connect/reflecttest/v1/reflecttest_ext.pb.go | 2 +- .../gen/go/connectext/grpc/reflection/v1/reflection.pb.go | 2 +- internal/proto/connect/reflecttest/v1/reflecttest.proto | 2 +- .../proto/connect/reflecttest/v1/reflecttest_ext.proto | 2 +- internal/resolvertest/resolverhack_test.go | 2 +- 15 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b0fe59a..ff8a8d5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,14 +15,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [1.19.x,1.20.x,1.21.x] + go-version: [1.20.x,1.21.x,1.22.x] steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Test @@ -30,5 +30,5 @@ jobs: - name: Lint # Often, lint & gofmt guidelines depend on the Go version. To prevent # conflicting guidance, run only on the most recent supported version. - if: matrix.go-version == '1.21.x' + if: matrix.go-version == '1.22.x' run: make checkgenerate && make lint diff --git a/.golangci.yml b/.golangci.yml index 7fdcf4c..5f7c2d0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -39,14 +39,16 @@ linters: - golint # deprecated by Go team - gomnd # some unnamed constants are okay - ifshort # deprecated by author + - inamedparam # convention is not followed - interfacer # deprecated by author - ireturn # "accept interfaces, return structs" isn't ironclad - lll # don't want hard limits for line length - maintidx # covered by gocyclo - maligned # readability trumps efficient struct packing - - musttag # buggy in release 1.54.1, fails with mysterious error - nlreturn # generous whitespace violates house style + - nonamedreturns # named returns are fine; it's *bare* returns that are bad - nosnakecase # deprecated in https://github.com/golangci/golangci-lint/pull/3065 + - protogetter # too many false positives - scopelint # deprecated by author - structcheck # abandoned - testpackage # internal tests are fine diff --git a/Makefile b/Makefile index ce2c891..8052693 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ MAKEFLAGS += --no-print-directory BIN=$(abspath .tmp/bin) export PATH := $(BIN):$(PATH) export GOBIN := $(abspath $(BIN)) -COPYRIGHT_YEARS := 2022-2023 +COPYRIGHT_YEARS := 2022-2024 LICENSE_IGNORE := --ignore /testdata/ --ignore internal/proto/connectext/ .PHONY: help @@ -71,15 +71,15 @@ checkgenerate: $(BIN)/buf: Makefile @mkdir -p $(@D) - go install github.com/bufbuild/buf/cmd/buf@v1.26.1 + go install github.com/bufbuild/buf/cmd/buf@v1.29.0 $(BIN)/license-header: Makefile @mkdir -p $(@D) - go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v1.26.1 + go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v1.29.0 $(BIN)/golangci-lint: Makefile @mkdir -p $(@D) - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.1 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 $(BIN)/protoc-gen-go: Makefile @mkdir -p $(@D) diff --git a/client.go b/client.go index 613a151..52b9554 100644 --- a/client.go +++ b/client.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/client_example_test.go b/client_example_test.go index c62be9b..3664f82 100644 --- a/client_example_test.go +++ b/client_example_test.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/client_test.go b/client_test.go index 478712f..d0281e5 100644 --- a/client_test.go +++ b/client_test.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/go.mod b/go.mod index ba9a420..38f532d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module connectrpc.com/grpcreflect -go 1.19 +go 1.20 require ( connectrpc.com/connect v1.11.0 diff --git a/grpcreflect.go b/grpcreflect.go index 38828ec..297174d 100644 --- a/grpcreflect.go +++ b/grpcreflect.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/grpcreflect_test.go b/grpcreflect_test.go index a60b96b..448e239 100644 --- a/grpcreflect_test.go +++ b/grpcreflect_test.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/gen/go/connect/reflecttest/v1/reflecttest.pb.go b/internal/gen/go/connect/reflecttest/v1/reflecttest.pb.go index 37886b2..eb46fa7 100644 --- a/internal/gen/go/connect/reflecttest/v1/reflecttest.pb.go +++ b/internal/gen/go/connect/reflecttest/v1/reflecttest.pb.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/gen/go/connect/reflecttest/v1/reflecttest_ext.pb.go b/internal/gen/go/connect/reflecttest/v1/reflecttest_ext.pb.go index c2da2e4..bb44bd0 100644 --- a/internal/gen/go/connect/reflecttest/v1/reflecttest_ext.pb.go +++ b/internal/gen/go/connect/reflecttest/v1/reflecttest_ext.pb.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/gen/go/connectext/grpc/reflection/v1/reflection.pb.go b/internal/gen/go/connectext/grpc/reflection/v1/reflection.pb.go index 243798f..6c36a9d 100644 --- a/internal/gen/go/connectext/grpc/reflection/v1/reflection.pb.go +++ b/internal/gen/go/connectext/grpc/reflection/v1/reflection.pb.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/proto/connect/reflecttest/v1/reflecttest.proto b/internal/proto/connect/reflecttest/v1/reflecttest.proto index 64472c2..aa2560c 100644 --- a/internal/proto/connect/reflecttest/v1/reflecttest.proto +++ b/internal/proto/connect/reflecttest/v1/reflecttest.proto @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/proto/connect/reflecttest/v1/reflecttest_ext.proto b/internal/proto/connect/reflecttest/v1/reflecttest_ext.proto index 698474d..0280181 100644 --- a/internal/proto/connect/reflecttest/v1/reflecttest_ext.proto +++ b/internal/proto/connect/reflecttest/v1/reflecttest_ext.proto @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/resolvertest/resolverhack_test.go b/internal/resolvertest/resolverhack_test.go index e5190cf..099f409 100644 --- a/internal/resolvertest/resolverhack_test.go +++ b/internal/resolvertest/resolverhack_test.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Connect Authors +// Copyright 2022-2024 The Connect Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.