From 6ffd1b21422b333e3847bbfe2bbe384dcd4df985 Mon Sep 17 00:00:00 2001 From: Mammar Date: Thu, 14 Nov 2024 09:49:45 +0100 Subject: [PATCH] feat: bump go to 1.23, adjust for new copyloopvar features --- .github/workflows/release.yml | 2 +- .github/workflows/review.yml | 2 +- .sage/go.mod | 2 +- encoding/protoavro/encoding_test.go | 2 -- encoding/protoavro/map_test.go | 3 --- encoding/protoavro/marshal_test.go | 1 - encoding/protoavro/schema_test.go | 2 -- encoding/protoavro/wkt_test.go | 2 -- go.mod | 20 +++++++++-------- go.sum | 34 ++++++++++++++--------------- 10 files changed, 31 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73ccaac..27691f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Sage uses: einride/sage/actions/setup@master with: - go-version: "1.20" + go-version: "1.23" - name: Make run: make diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 0d09e11..1de5453 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -11,7 +11,7 @@ jobs: - name: Setup Sage uses: einride/sage/actions/setup@master with: - go-version: "1.20" + go-version: "1.23" - name: Make run: make diff --git a/.sage/go.mod b/.sage/go.mod index 17f02c9..3bd48e7 100644 --- a/.sage/go.mod +++ b/.sage/go.mod @@ -1,5 +1,5 @@ module sage -go 1.17 +go 1.23 require go.einride.tech/sage v0.328.0 diff --git a/encoding/protoavro/encoding_test.go b/encoding/protoavro/encoding_test.go index 88eca48..5ddde86 100644 --- a/encoding/protoavro/encoding_test.go +++ b/encoding/protoavro/encoding_test.go @@ -568,7 +568,6 @@ func Test_JSON(t *testing.T) { }, }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { // t.Parallel() got, err := tt.opts.encodeJSON(tt.msg) @@ -1114,7 +1113,6 @@ func Test_OmitRoot_JSON(t *testing.T) { }, }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { tt.opts = SchemaOptions{OmitRootElement: true} // t.Parallel() diff --git a/encoding/protoavro/map_test.go b/encoding/protoavro/map_test.go index 7d0b20d..aa59d20 100644 --- a/encoding/protoavro/map_test.go +++ b/encoding/protoavro/map_test.go @@ -174,7 +174,6 @@ func Test_MapSchema(t *testing.T) { }), }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { schema, err := tt.opts.newSchemaInferrer().inferMapSchema( tt.msg.ProtoReflect().Descriptor().Fields().ByName(tt.fieldName), @@ -249,7 +248,6 @@ func Test_MapEncode(t *testing.T) { }, }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { desc := tt.msg.ProtoReflect().Descriptor().Fields().ByName(tt.fieldName) val := tt.msg.ProtoReflect().Get(desc) @@ -322,7 +320,6 @@ func Test_MapDecode(t *testing.T) { expectErr: "missing 'value' in map entry for 'string_to_string'", }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { desc := tt.msg.ProtoReflect().Descriptor().Fields().ByName(tt.fieldName) val := tt.msg.ProtoReflect().Mutable(desc) diff --git a/encoding/protoavro/marshal_test.go b/encoding/protoavro/marshal_test.go index 90a53a6..f454a77 100644 --- a/encoding/protoavro/marshal_test.go +++ b/encoding/protoavro/marshal_test.go @@ -99,7 +99,6 @@ func Test_MarshalSymmetric(t *testing.T) { }, }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { var b bytes.Buffer diff --git a/encoding/protoavro/schema_test.go b/encoding/protoavro/schema_test.go index 284b038..e89ed6d 100644 --- a/encoding/protoavro/schema_test.go +++ b/encoding/protoavro/schema_test.go @@ -558,7 +558,6 @@ func TestInferSchema(t *testing.T) { }), }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got, err := InferSchema(tt.msg.ProtoReflect().Descriptor()) @@ -1116,7 +1115,6 @@ func TestInferRootSchema(t *testing.T) { }, }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() got, err := SchemaOptions{OmitRootElement: true}.InferSchema(tt.msg.ProtoReflect().Descriptor()) diff --git a/encoding/protoavro/wkt_test.go b/encoding/protoavro/wkt_test.go index eea65ce..e50dce0 100644 --- a/encoding/protoavro/wkt_test.go +++ b/encoding/protoavro/wkt_test.go @@ -61,7 +61,6 @@ func Test_WKT(t *testing.T) { durationpb.New(time.Microsecond), durationpb.New(time.Minute*59 + time.Second*43), } { - tt := tt t.Run(string(tt.ProtoReflect().Descriptor().FullName()), func(t *testing.T) { encoded, err := SchemaOptions{}.encodeWKT(tt.ProtoReflect()) assert.NilError(t, err) @@ -139,7 +138,6 @@ func Test_DecodeWKTErr(t *testing.T) { errContains: "google.type.TimeOfDay: expected key 'long.time-micros'", }, } { - tt := tt t.Run(tt.name, func(t *testing.T) { err := decodeWKT(tt.data, tt.msg.ProtoReflect()) assert.ErrorContains(t, err, tt.errContains) diff --git a/go.mod b/go.mod index f47c328..01141ea 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,24 @@ module go.einride.tech/protobuf-avro -go 1.20 +go 1.23 + +toolchain go1.23.1 require ( - cloud.google.com/go v0.115.1 + cloud.google.com/go v0.116.0 github.com/google/go-cmp v0.6.0 github.com/linkedin/goavro/v2 v2.13.0 - google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf + google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 google.golang.org/protobuf v1.34.2 gotest.tools/v3 v3.5.1 ) require ( github.com/golang/snappy v0.0.4 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect - google.golang.org/grpc v1.64.1 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.2 // indirect ) diff --git a/go.sum b/go.sum index 58a700b..d3c15f9 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= -cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= +cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= +cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -15,22 +15,22 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf h1:OqdXDEakZCVtDiZTjcxfwbHPCT11ycCEsTKesBVKvyY= -google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:mCr1K1c8kX+1iSBREvU3Juo11CB+QOEWxbRS01wWl5M= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f h1:b1Ln/PG8orm0SsBbHZWke8dDp2lrCD4jSmfglFpTZbk= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:hL97c3SYopEHblzpxRL4lSs523++l8DYxGM1FQiYmb4= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=