diff --git a/Makefile b/Makefile index eeacff7..e856068 100644 --- a/Makefile +++ b/Makefile @@ -32,3 +32,6 @@ go.mod.tidy: go.mod.vendor: cd sh && sh ./go.mod.vendor.sh + +go.work.sync: + cd sh && sh ./go.work.sync.sh diff --git a/drivers/go-redis-v8/go.work b/drivers/go-redis-v8/go.work index 11d684b..180619c 100644 --- a/drivers/go-redis-v8/go.work +++ b/drivers/go-redis-v8/go.work @@ -3,4 +3,3 @@ go 1.21 use . replace github.com/avito-tech/go-transaction-manager/v2 => ../../ - diff --git a/drivers/gorm/go.work b/drivers/gorm/go.work index bb5c9df..6e5594f 100644 --- a/drivers/gorm/go.work +++ b/drivers/gorm/go.work @@ -3,4 +3,5 @@ go 1.21 use . replace github.com/avito-tech/go-transaction-manager/v2 => ../../ -replace github.com/avito-tech/go-transaction-manager/drivers/sql/v2 => ../sql \ No newline at end of file + +replace github.com/avito-tech/go-transaction-manager/drivers/sql/v2 => ../sql diff --git a/drivers/mongo/go.mod b/drivers/mongo/go.mod index 0fcf73e..ab2b655 100644 --- a/drivers/mongo/go.mod +++ b/drivers/mongo/go.mod @@ -10,6 +10,3 @@ require ( go.mongodb.org/mongo-driver v1.13.1 ) -replace github.com/avito-tech/go-transaction-manager/drivers/sql/v2 v2.0.0 => ../sql - -replace github.com/avito-tech/go-transaction-manager/v2 v2.0.0 => ../../ diff --git a/drivers/mongo/go.work b/drivers/mongo/go.work index c27816b..6e5594f 100644 --- a/drivers/mongo/go.work +++ b/drivers/mongo/go.work @@ -3,5 +3,5 @@ go 1.21 use . replace github.com/avito-tech/go-transaction-manager/v2 => ../../ -replace github.com/avito-tech/go-transaction-manager/drivers/sql/v2 => ../sql +replace github.com/avito-tech/go-transaction-manager/drivers/sql/v2 => ../sql diff --git a/drivers/pgxv4/go.mod b/drivers/pgxv4/go.mod index dd30b5a..6b15a1c 100644 --- a/drivers/pgxv4/go.mod +++ b/drivers/pgxv4/go.mod @@ -9,5 +9,3 @@ require ( github.com/pashagolub/pgxmock v1.8.0 github.com/stretchr/testify v1.8.2 ) - -replace github.com/avito-tech/go-transaction-manager/v2 v2.0.0 => ../../ diff --git a/drivers/pgxv4/go.work b/drivers/pgxv4/go.work index 11d684b..180619c 100644 --- a/drivers/pgxv4/go.work +++ b/drivers/pgxv4/go.work @@ -3,4 +3,3 @@ go 1.21 use . replace github.com/avito-tech/go-transaction-manager/v2 => ../../ - diff --git a/drivers/pgxv5/go.work b/drivers/pgxv5/go.work index 11d684b..180619c 100644 --- a/drivers/pgxv5/go.work +++ b/drivers/pgxv5/go.work @@ -3,4 +3,3 @@ go 1.21 use . replace github.com/avito-tech/go-transaction-manager/v2 => ../../ - diff --git a/drivers/sql/go.work.sum b/drivers/sql/go.work.sum new file mode 100644 index 0000000..1a8b847 --- /dev/null +++ b/drivers/sql/go.work.sum @@ -0,0 +1 @@ +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= diff --git a/drivers/sqlx/go.mod b/drivers/sqlx/go.mod index 459a48f..7a020e5 100644 --- a/drivers/sqlx/go.mod +++ b/drivers/sqlx/go.mod @@ -11,7 +11,3 @@ require ( github.com/stretchr/testify v1.8.2 go.uber.org/multierr v1.9.0 ) - -replace github.com/avito-tech/go-transaction-manager/v2 v2.0.0 => ../../ - -replace github.com/avito-tech/go-transaction-manager/drivers/sql/v2 v2.0.0 => ../sql diff --git a/drivers/sqlx/go.work b/drivers/sqlx/go.work index c27816b..6e5594f 100644 --- a/drivers/sqlx/go.work +++ b/drivers/sqlx/go.work @@ -3,5 +3,5 @@ go 1.21 use . replace github.com/avito-tech/go-transaction-manager/v2 => ../../ -replace github.com/avito-tech/go-transaction-manager/drivers/sql/v2 => ../sql +replace github.com/avito-tech/go-transaction-manager/drivers/sql/v2 => ../sql diff --git a/drivers/sqlx/go.work.sum b/drivers/sqlx/go.work.sum new file mode 100644 index 0000000..1a8b847 --- /dev/null +++ b/drivers/sqlx/go.work.sum @@ -0,0 +1 @@ +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= diff --git a/go.mod b/go.mod index 1b1b948..1592f45 100644 --- a/go.mod +++ b/go.mod @@ -13,4 +13,3 @@ require ( go.uber.org/multierr v1.9.0 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) - diff --git a/sh/go.mod.tidy.sh b/sh/go.mod.tidy.sh index 2169a3c..35c7c4d 100755 --- a/sh/go.mod.tidy.sh +++ b/sh/go.mod.tidy.sh @@ -1,18 +1,21 @@ #!/bin/bash +DIR=$(pwd) +drivers=$($DIR/utils/drivers.sh) + cd ../ ROOT=$(pwd) -go mod tidy - -drivers=$($DIR/utils/drivers.sh) +go mod tidy & for driver in $drivers; do if [ -d "$driver" ]; then echo "\n$driver" - cd $driver && go mod tidy + cd $driver && go mod tidy & cd $ROOT fi done + +wait \ No newline at end of file diff --git a/sh/go.mod.vendor.local.sh b/sh/go.mod.vendor.local.sh index 52c06cc..b0e335b 100755 --- a/sh/go.mod.vendor.local.sh +++ b/sh/go.mod.vendor.local.sh @@ -1,22 +1,22 @@ #!/bin/bash +DIR=$(pwd) +drivers=$($DIR/utils/drivers.sh) + cd ../ ROOT=$(pwd) -go mod vendor - -drivers=$($DIR/utils/drivers.sh) +go mod vendor & for driver in $drivers; do if [ -d "$driver" ]; then echo "\n$driver" - cd $driver && \ - $ROOT/sh/utils/go.mod.replace.default.sh - go mod vendor && \ - $ROOT/sh/utils/go.mod.dropreplace.default.sh + cd $driver && go mod vendor & cd $ROOT fi done + +wait diff --git a/sh/go.work.sync.sh b/sh/go.work.sync.sh new file mode 100755 index 0000000..6473cc7 --- /dev/null +++ b/sh/go.work.sync.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +DIR=$(pwd) +drivers=$($DIR/utils/drivers.sh) + +cd ../ + +ROOT=$(pwd) + +for driver in $drivers; do + if [ -d "$driver" ]; then + echo "\n$driver" + cd $driver && go work sync & + + cd $ROOT + fi +done + +wait \ No newline at end of file