From e152b7265a5d324b590c44bff28927bfdddb85fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Barroso?= Date: Thu, 1 Aug 2024 12:42:46 +0100 Subject: [PATCH] chore: update to latest commons and remove ptr fn (#161) --- go.mod | 4 ++-- go.sum | 8 ++++---- source.go | 9 +++------ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index a230f67..f862671 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.5 require ( github.com/Masterminds/sprig/v3 v3.2.3 - github.com/conduitio/conduit-commons v0.2.1-0.20240717151024-0c8d1f406cb2 + github.com/conduitio/conduit-commons v0.2.1-0.20240801103647-5b6da75a3a39 github.com/conduitio/conduit-connector-sdk v0.9.2-0.20240731123633-05f6d05cf002 github.com/goccy/go-json v0.10.3 github.com/golangci/golangci-lint v1.59.1 @@ -89,7 +89,7 @@ require ( github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect - github.com/hamba/avro/v2 v2.22.1 // indirect + github.com/hamba/avro/v2 v2.23.0 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.6.1 // indirect github.com/hashicorp/go-version v1.7.0 // indirect diff --git a/go.sum b/go.sum index 0fd505a..c09ee34 100644 --- a/go.sum +++ b/go.sum @@ -75,8 +75,8 @@ github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/ckaznocha/intrange v0.1.2 h1:3Y4JAxcMntgb/wABQ6e8Q8leMd26JbX2790lIss9MTI= github.com/ckaznocha/intrange v0.1.2/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE= -github.com/conduitio/conduit-commons v0.2.1-0.20240717151024-0c8d1f406cb2 h1:0Ba/B4lyxeGIVk4zvVGRx1kAdLuXK+8st/LyMKZCmu4= -github.com/conduitio/conduit-commons v0.2.1-0.20240717151024-0c8d1f406cb2/go.mod h1:w0eHaH81yoab8VcrrTjFGNGRQMx45RnXWobKMpKjgrM= +github.com/conduitio/conduit-commons v0.2.1-0.20240801103647-5b6da75a3a39 h1:HW6b+sA6RkZ9KGy+r+zA6taUKqaQwQcs6ZIcutgUv4c= +github.com/conduitio/conduit-commons v0.2.1-0.20240801103647-5b6da75a3a39/go.mod h1:G07iD8aJRD3s1pvO+t8yv7/vMeKbMoSGFhZfemdLT8Y= github.com/conduitio/conduit-connector-protocol v0.6.1-0.20240730102156-29a2e67ad980 h1:Hwg9Ho0Rvrg0rVype0yQA7jJtGrG4zY6RQzvcXAi4Kk= github.com/conduitio/conduit-connector-protocol v0.6.1-0.20240730102156-29a2e67ad980/go.mod h1:GyI6kkdR55JGM/96v5OSI7vlVodur3L22SY+OJbPd0s= github.com/conduitio/conduit-connector-sdk v0.9.2-0.20240731123633-05f6d05cf002 h1:blkPwC39ZnLxleOoP10NCrBa6rMxY637F+kGXuaUfkY= @@ -191,8 +191,8 @@ github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= -github.com/hamba/avro/v2 v2.22.1 h1:q1rAbfJsrbMaZPDLQvwUQMfQzp6H+hGXvckmU/lXemk= -github.com/hamba/avro/v2 v2.22.1/go.mod h1:HOeTrE3kvWnBAgsufqhAzDDV5gvS0QXs65Z6BHfGgbg= +github.com/hamba/avro/v2 v2.23.0 h1:DYWz6UqNCi21JflaZlcwNfW+rK+D/CwnrWWJtfmO4vw= +github.com/hamba/avro/v2 v2.23.0/go.mod h1:7vDfy/2+kYCE8WUHoj2et59GTv0ap7ptktMXu0QHePI= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI= diff --git a/source.go b/source.go index e18a217..87b50ef 100644 --- a/source.go +++ b/source.go @@ -19,6 +19,7 @@ import ( "fmt" "github.com/conduitio/conduit-commons/config" + "github.com/conduitio/conduit-commons/lang" "github.com/conduitio/conduit-commons/opencdc" "github.com/conduitio/conduit-connector-kafka/source" sdk "github.com/conduitio/conduit-connector-sdk" @@ -36,18 +37,14 @@ type Source struct { config source.Config } -func ptr[T any](t T) *T { - return &t -} - func NewSource() sdk.Source { return sdk.SourceWithMiddleware( &Source{}, sdk.DefaultSourceMiddleware( // disable schema extraction by default, because the source produces raw data sdk.SourceWithSchemaExtractionConfig{ - PayloadEnabled: ptr(false), - KeyEnabled: ptr(false), + PayloadEnabled: lang.Ptr((false)), + KeyEnabled: lang.Ptr(false), }.Apply, )..., )