From 2a82cbe6fc7d64eba6753e729792011b92192ac0 Mon Sep 17 00:00:00 2001 From: Mike Fridman Date: Sat, 16 Sep 2023 09:08:05 -0400 Subject: [PATCH] use multierr instead of errors.join --- go.mod | 1 + go.sum | 2 ++ internal/sqladapter/store_test.go | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index b8aaaa724..43ca83dc4 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/ory/dockertest/v3 v3.10.0 github.com/vertica/vertica-sql-go v1.3.3 github.com/ziutek/mymysql v1.5.4 + go.uber.org/multierr v1.11.0 modernc.org/sqlite v1.25.0 ) diff --git a/go.sum b/go.sum index 659c7bb7a..89df3d7ba 100644 --- a/go.sum +++ b/go.sum @@ -159,6 +159,8 @@ go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= diff --git a/internal/sqladapter/store_test.go b/internal/sqladapter/store_test.go index 8c69e405b..2c6c384af 100644 --- a/internal/sqladapter/store_test.go +++ b/internal/sqladapter/store_test.go @@ -11,6 +11,7 @@ import ( "github.com/pressly/goose/v3/internal/check" "github.com/pressly/goose/v3/internal/sqladapter" "github.com/pressly/goose/v3/internal/testdb" + "go.uber.org/multierr" ) // The goal of this test is to verify the sqladapter package works as expected. This test is not @@ -141,7 +142,7 @@ func runTx(ctx context.Context, db *sql.DB, fn func(*sql.Tx) error) (retErr erro } defer func() { if retErr != nil { - retErr = errors.Join(retErr, tx.Rollback()) + retErr = multierr.Append(retErr, tx.Rollback()) } }() if err := fn(tx); err != nil { @@ -157,7 +158,7 @@ func runConn(ctx context.Context, db *sql.DB, fn func(*sql.Conn) error) (retErr } defer func() { if retErr != nil { - retErr = errors.Join(retErr, conn.Close()) + retErr = multierr.Append(retErr, conn.Close()) } }() if err := fn(conn); err != nil {