From b096a259fee8a06b900db0dd13777940e41f4b7f Mon Sep 17 00:00:00 2001 From: Christopher Hlubek Date: Thu, 19 Sep 2024 13:57:24 +0200 Subject: [PATCH 1/2] Implement Go 1.23 iterator function for iterating rows --- .github/workflows/test.yml | 6 +- constructsql/constructsql.go | 10 +- constructsql/constructsql_iterator.go | 55 +++++ constructsql/constructsql_iterator_test.go | 258 +++++++++++++++++++++ constructsql/constructsql_test.go | 147 ++++++++++++ example/go.mod | 25 +- example/go.sum | 52 +++-- go.mod | 18 +- go.sum | 35 +-- go.work | 6 +- go.work.sum | 35 ++- 11 files changed, 573 insertions(+), 74 deletions(-) create mode 100644 constructsql/constructsql_iterator.go create mode 100644 constructsql/constructsql_iterator_test.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed008c6..99068f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.21' - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: @@ -26,7 +26,7 @@ jobs: test: strategy: matrix: - go-version: [ '1.20', '1.21' ] + go-version: [ '1.21', '1.22', '1.23' ] platform: [ 'ubuntu-latest' ] runs-on: ${{ matrix.platform }} steps: @@ -48,7 +48,7 @@ jobs: if: success() uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.23' - name: Calc coverage run: | go test -cover ./... -coverpkg=github.com/networkteam/construct/v2/... -coverprofile=coverage.txt diff --git a/constructsql/constructsql.go b/constructsql/constructsql.go index 0153511..fbfdc43 100644 --- a/constructsql/constructsql.go +++ b/constructsql/constructsql.go @@ -10,12 +10,14 @@ import ( ) // CollectRows collects all rows to the given target type from a ExecutiveQueryBuilder.Query result. -func CollectRows[T any](rows Rows, err error) ([]T, error) { - if err != nil { - return nil, err +func CollectRows[T any](rows Rows, queryErr error) (result []T, err error) { + if queryErr != nil { + return nil, queryErr } - defer rows.Close() + defer func() { + err = errors.Join(err, rows.Close()) + }() slice := []T{} diff --git a/constructsql/constructsql_iterator.go b/constructsql/constructsql_iterator.go new file mode 100644 index 0000000..25d358f --- /dev/null +++ b/constructsql/constructsql_iterator.go @@ -0,0 +1,55 @@ +//go:build go1.23 + +package constructsql + +import ( + "errors" + "iter" + "log" +) + +// IterateRows returns an iterator over the rows of a database query and scans them to T. +// It returns a single-use iterator. +func IterateRows[T any](rows Rows, err error) iter.Seq2[T, error] { + if err != nil { + return func(yield func(T, error) bool) { + var result T + yield(result, err) + } + } + + return func(yield func(T, error) bool) { + var err error + var iteratorClosed bool + + defer func() { + closeErr := rows.Close() + if iteratorClosed && closeErr != nil { + log.Printf("constructsql: Error closing rows after function for loop body returned false: %v", closeErr) + return + } + + err = errors.Join(err, closeErr) + if err != nil { + var result T + yield(result, err) + } + }() + + var value T + for rows.Next() { + value, err = scanRow[T](rows) + if err != nil { + return + } + if !yield(value, nil) { + iteratorClosed = true + return + } + } + + if err = rows.Err(); err != nil { + return + } + } +} diff --git a/constructsql/constructsql_iterator_test.go b/constructsql/constructsql_iterator_test.go new file mode 100644 index 0000000..02f28be --- /dev/null +++ b/constructsql/constructsql_iterator_test.go @@ -0,0 +1,258 @@ +//go:build go1.23 + +package constructsql_test + +import ( + "errors" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/networkteam/construct/v2/constructsql" +) + +func TestIterateRows(t *testing.T) { + t.Run("iterate rows without error", func(t *testing.T) { + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + }, + } + + count := 0 + for record, err := range constructsql.IterateRows[user](&rows, nil) { + require.NoError(t, err) + assert.Equal(t, user{ID: 1, Name: "test"}, record) + count++ + } + assert.Equal(t, 1, count) + + assert.True(t, rows.closed) + }) + + t.Run("iterate empty rows without error", func(t *testing.T) { + rows := mockRows{ + rows: []mockRow{}, + } + + count := 0 + for range constructsql.IterateRows[user](&rows, nil) { + count++ + } + assert.Equal(t, 0, count) + + assert.True(t, rows.closed) + }) + + t.Run("iterate rows with early break", func(t *testing.T) { + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + { + scanJSON: []byte(`{"id": 2, "name": "test"}`), + }, + }, + } + + count := 0 + for record, err := range constructsql.IterateRows[user](&rows, nil) { + if count == 0 { + require.NoError(t, err) + assert.Equal(t, user{ID: 1, Name: "test"}, record) + } else { + break + } + count++ + } + assert.Equal(t, 1, count) + + assert.True(t, rows.closed) + }) + + t.Run("iterate rows with early break and close error", func(t *testing.T) { + closeErr := errors.New("some error on close") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + { + scanJSON: []byte(`{"id": 2, "name": "test"}`), + }, + }, + closeErr: closeErr, + } + + count := 0 + for record, err := range constructsql.IterateRows[user](&rows, nil) { + if count == 0 { + require.NoError(t, err) + assert.Equal(t, user{ID: 1, Name: "test"}, record) + } else { + break + } + count++ + } + assert.Equal(t, 1, count) + + assert.True(t, rows.closed) + }) + + t.Run("iterate rows with initial error", func(t *testing.T) { + rows := mockRows{} + initialErr := errors.New("some initial error") + count := 0 + for _, err := range constructsql.IterateRows[user](&rows, initialErr) { + assert.ErrorIs(t, err, initialErr) + count++ + } + assert.Equal(t, 1, count) + + assert.False(t, rows.closed) + }) + + t.Run("iterate rows with scan error", func(t *testing.T) { + scanErr := errors.New("some scan error") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + { + scanErr: scanErr, + }, + }, + } + + count := 0 + for record, err := range constructsql.IterateRows[user](&rows, nil) { + if count == 0 { + require.NoError(t, err) + assert.Equal(t, user{ID: 1, Name: "test"}, record) + } else if count == 1 { + assert.ErrorIs(t, err, scanErr) + } + count++ + } + assert.Equal(t, 2, count) + + assert.True(t, rows.closed) + }) + + t.Run("iterate rows with iterate error", func(t *testing.T) { + iterateErr := errors.New("some iterate error") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + }, + iterateErr: iterateErr, + } + + count := 0 + for record, err := range constructsql.IterateRows[user](&rows, nil) { + if count == 0 { + require.NoError(t, err) + assert.Equal(t, user{ID: 1, Name: "test"}, record) + } else if count == 1 { + assert.ErrorIs(t, err, iterateErr) + } + count++ + } + assert.Equal(t, 2, count) + + assert.True(t, rows.closed) + }) + + t.Run("iterate rows with close error", func(t *testing.T) { + closeErr := errors.New("some error on close") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + }, + closeErr: closeErr, + } + + count := 0 + for record, err := range constructsql.IterateRows[user](&rows, nil) { + if count == 0 { + require.NoError(t, err) + assert.Equal(t, user{ID: 1, Name: "test"}, record) + } else if count == 1 { + assert.ErrorIs(t, err, closeErr) + } + count++ + } + assert.Equal(t, 2, count) + + assert.True(t, rows.closed) + }) + + t.Run("iterate rows with scan and close error", func(t *testing.T) { + scanErr := errors.New("some scan error") + closeErr := errors.New("some error on close") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + { + scanErr: scanErr, + }, + }, + closeErr: closeErr, + } + + count := 0 + for record, err := range constructsql.IterateRows[user](&rows, nil) { + if count == 0 { + require.NoError(t, err) + assert.Equal(t, user{ID: 1, Name: "test"}, record) + } else if count == 1 { + assert.ErrorIs(t, err, scanErr) + assert.ErrorIs(t, err, closeErr) + } + count++ + } + assert.Equal(t, 2, count) + + assert.True(t, rows.closed) + }) + + t.Run("iterate rows with iterate and close error", func(t *testing.T) { + iterateErr := errors.New("some iterate error") + closeErr := errors.New("some error on close") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + }, + iterateErr: iterateErr, + closeErr: closeErr, + } + + count := 0 + for record, err := range constructsql.IterateRows[user](&rows, nil) { + if count == 0 { + require.NoError(t, err) + assert.Equal(t, user{ID: 1, Name: "test"}, record) + } else if count == 1 { + assert.ErrorIs(t, err, iterateErr) + assert.ErrorIs(t, err, closeErr) + } + count++ + } + assert.Equal(t, 2, count) + + assert.True(t, rows.closed) + }) +} diff --git a/constructsql/constructsql_test.go b/constructsql/constructsql_test.go index af1a373..8fd48b8 100644 --- a/constructsql/constructsql_test.go +++ b/constructsql/constructsql_test.go @@ -40,6 +40,153 @@ func (r *mockRow) Scan(dest ...any) error { return nil } +type mockRows struct { + rows []mockRow + closeErr error + iterateErr error + + cursor int + closed bool +} + +func (m *mockRows) Scan(dest ...any) error { + if m.cursor == 0 { + return errors.New("mockRows.Scan: before first row, must call Next first") + } + if m.cursor > len(m.rows) { + return errors.New("mockRows.Scan: after last row") + } + + return m.rows[m.cursor-1].Scan(dest...) +} + +func (m *mockRows) Next() bool { + m.cursor++ + return m.cursor <= len(m.rows) +} + +func (m *mockRows) Close() error { + m.closed = true + return m.closeErr +} + +func (m *mockRows) Err() error { + return m.iterateErr +} + +var _ constructsql.Rows = &mockRows{} + +func TestCollectRows(t *testing.T) { + t.Run("collect rows without error", func(t *testing.T) { + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + }, + } + records, err := constructsql.CollectRows[user](&rows, nil) + require.NoError(t, err) + + assert.Equal(t, []user{{ID: 1, Name: "test"}}, records) + assert.True(t, rows.closed) + }) + + t.Run("collect empty rows without error", func(t *testing.T) { + rows := mockRows{ + rows: []mockRow{}, + } + records, err := constructsql.CollectRows[user](&rows, nil) + require.NoError(t, err) + + assert.Len(t, records, 0) + assert.True(t, rows.closed) + }) + + t.Run("collect rows with initial error", func(t *testing.T) { + rows := mockRows{} + initialErr := errors.New("some initial error") + records, err := constructsql.CollectRows[user](&rows, initialErr) + require.ErrorIs(t, err, initialErr) + assert.False(t, rows.closed) + + assert.Empty(t, records) + }) + + t.Run("collect rows with scan error", func(t *testing.T) { + scanErr := errors.New("some scan error") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + { + scanErr: scanErr, + }, + }, + } + records, err := constructsql.CollectRows[user](&rows, nil) + require.ErrorIs(t, err, scanErr) + + assert.Empty(t, records) + assert.True(t, rows.closed) + }) + + t.Run("collect rows with iterate error", func(t *testing.T) { + iterateErr := errors.New("some iterate error") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + }, + iterateErr: iterateErr, + } + records, err := constructsql.CollectRows[user](&rows, nil) + require.ErrorIs(t, err, iterateErr) + + assert.Empty(t, records) + assert.True(t, rows.closed) + }) + + t.Run("collect rows with close error", func(t *testing.T) { + closeErr := errors.New("some error on close") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + }, + closeErr: closeErr, + } + _, err := constructsql.CollectRows[user](&rows, nil) + require.ErrorIs(t, err, closeErr) + + assert.True(t, rows.closed) + }) + + t.Run("collect rows with scan and close error", func(t *testing.T) { + scanErr := errors.New("some scan error") + closeErr := errors.New("some error on close") + rows := mockRows{ + rows: []mockRow{ + { + scanJSON: []byte(`{"id": 1, "name": "test"}`), + }, + { + scanErr: scanErr, + }, + }, + closeErr: closeErr, + } + _, err := constructsql.CollectRows[user](&rows, nil) + require.ErrorIs(t, err, scanErr) + require.ErrorIs(t, err, closeErr) + + assert.True(t, rows.closed) + }) +} + func TestScanRow(t *testing.T) { t.Run("scans row without error", func(t *testing.T) { row := mockRow{ diff --git a/example/go.mod b/example/go.mod index d00966f..f91013a 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,31 +1,34 @@ module github.com/networkteam/construct/v2/example -go 1.20 +go 1.21 + +toolchain go1.23.1 require ( github.com/gofrs/uuid v4.4.0+incompatible - github.com/jackc/pgx/v5 v5.3.1 + github.com/jackc/pgx/v5 v5.7.1 github.com/networkteam/construct/v2 v2.0.0 - github.com/networkteam/qrb v0.3.2 + github.com/networkteam/qrb v0.7.0 github.com/olekukonko/tablewriter v0.0.5 - github.com/urfave/cli/v2 v2.25.1 + github.com/urfave/cli/v2 v2.25.7 ) require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/dave/jennifer v1.6.0 // indirect + github.com/dave/jennifer v1.7.0 // indirect github.com/fatih/structtag v1.2.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/mod v0.10.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/tools v0.7.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect ) replace github.com/networkteam/construct/v2 => ../ diff --git a/example/go.sum b/example/go.sum index 1643938..1b4fa2e 100644 --- a/example/go.sum +++ b/example/go.sum @@ -1,28 +1,33 @@ +github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/dave/jennifer v1.6.0 h1:MQ/6emI2xM7wt0tJzJzyUik2Q3Tcn2eE0vtYgh4GPVI= -github.com/dave/jennifer v1.6.0/go.mod h1:AxTG893FiZKqxy3FP1kL80VMshSMuz2G+EgvszgGRnk= +github.com/dave/jennifer v1.7.0 h1:uRbSBH9UTS64yXbh4FrMHfgfY762RD+C7bUPKODpSJE= +github.com/dave/jennifer v1.7.0/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= 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= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= -github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= -github.com/jackc/puddle/v2 v2.2.0 h1:RdcDk92EJBuBS55nQMMYFXTxwstHug4jkhT5pq8VxPk= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs= +github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/networkteam/qrb v0.3.2 h1:+RiQR/ZC7/JXA9MllFU9ZN/Z7Cd/sLlKfFNzM+J2rT4= -github.com/networkteam/qrb v0.3.2/go.mod h1:rRD44E0t1wI+YHLOH/CPUIbYx/dKgetNYkFXVixDPfc= +github.com/networkteam/qrb v0.7.0 h1:nkWtInDA5TJ8phiXrJX2z1sdJGBKXNasX7a2e19xOAk= +github.com/networkteam/qrb v0.7.0/go.mod h1:Jvp7pXkwRQ+SPTOzW0eOKOp4/nW6h4l3a+z7LYcLddw= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/pashagolub/pgxmock/v2 v2.6.0 h1:Dk07FlzdMOrqdxrelmEeWP9uqcDm757HZWrIwyvdPsE= +github.com/pashagolub/pgxmock/v2 v2.6.0/go.mod h1:FsT+LxxrLNqeRWHzk2SBrSW+5m+kXLcKoVZxigHVHeI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -33,22 +38,23 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= -github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/go.mod b/go.mod index 1c419be..fdbed05 100644 --- a/go.mod +++ b/go.mod @@ -1,29 +1,31 @@ module github.com/networkteam/construct/v2 -go 1.20 +go 1.21 + +toolchain go1.23.1 require ( github.com/dave/jennifer v1.7.0 github.com/fatih/structtag v1.2.0 github.com/gofrs/uuid v4.4.0+incompatible - github.com/jackc/pgx/v5 v5.3.1 + github.com/jackc/pgx/v5 v5.7.1 github.com/networkteam/qrb v0.7.0 github.com/stretchr/testify v1.8.4 github.com/urfave/cli/v2 v2.25.7 - golang.org/x/tools v0.13.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d ) require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/sys v0.12.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/text v0.18.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 3d7d37d..dfa07d1 100644 --- a/go.sum +++ b/go.sum @@ -11,17 +11,22 @@ github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1 github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= -github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs= +github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/networkteam/qrb v0.7.0 h1:nkWtInDA5TJ8phiXrJX2z1sdJGBKXNasX7a2e19xOAk= github.com/networkteam/qrb v0.7.0/go.mod h1:Jvp7pXkwRQ+SPTOzW0eOKOp4/nW6h4l3a+z7LYcLddw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -33,19 +38,19 @@ github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/go.work b/go.work index 74f5d1c..5b2bb32 100644 --- a/go.work +++ b/go.work @@ -1,6 +1,8 @@ -go 1.20 +go 1.21 + +toolchain go1.23.1 use ( . example -) \ No newline at end of file +) diff --git a/go.work.sum b/go.work.sum index b808f2b..d275cf7 100644 --- a/go.work.sum +++ b/go.work.sum @@ -20,27 +20,31 @@ github.com/dave/patsy v0.0.0-20210517141501-957256f50cba h1:1o36L4EKbZzazMk8iGC4 github.com/dave/patsy v0.0.0-20210517141501-957256f50cba/go.mod h1:qfR88CgEGLoiqDaE+xxDCi5QA5v4vUoW0UCX2Nd5Tlc= github.com/dave/rebecca v0.9.1 h1:jxVfdOxRirbXL28vXMvUvJ1in3djwkVKXCq339qhBL0= github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/networkteam/qrb v0.2.6/go.mod h1:rRD44E0t1wI+YHLOH/CPUIbYx/dKgetNYkFXVixDPfc= github.com/pashagolub/pgxmock/v2 v2.6.0/go.mod h1:FsT+LxxrLNqeRWHzk2SBrSW+5m+kXLcKoVZxigHVHeI= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= @@ -49,18 +53,33 @@ golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= From 753a78476ce025db4925841a79540cf6a29da3fd Mon Sep 17 00:00:00 2001 From: Christopher Hlubek Date: Thu, 19 Sep 2024 14:05:34 +0200 Subject: [PATCH 2/2] Adjust version for lint --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99068f4..2de4edd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,11 +17,11 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: '1.23' - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.52 + version: v1.61 test: strategy: