From 10f9c007bca00bbf023456dd097361e30c476868 Mon Sep 17 00:00:00 2001 From: maranqz Date: Sat, 3 Aug 2024 21:32:16 +0400 Subject: [PATCH] 1. fix dependency --- drivers/pgxv4/go.mod | 2 ++ drivers/pgxv5/go.mod | 17 +---------------- sh/go.test.sh | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/pgxv4/go.mod b/drivers/pgxv4/go.mod index 8c82f1c..646bde5 100644 --- a/drivers/pgxv4/go.mod +++ b/drivers/pgxv4/go.mod @@ -16,3 +16,5 @@ exclude ( github.com/jackc/pgconn v1.14.3 golang.org/x/text v0.14.0 ) + +exclude golang.org/x/text v0.14.0 diff --git a/drivers/pgxv5/go.mod b/drivers/pgxv5/go.mod index 90096c1..608bdf8 100644 --- a/drivers/pgxv5/go.mod +++ b/drivers/pgxv5/go.mod @@ -8,19 +8,4 @@ require ( github.com/pashagolub/pgxmock/v2 v2.12.0 github.com/stretchr/testify v1.8.2 go.uber.org/goleak v1.3.0 -) - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/mock v1.6.0 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/puddle/v2 v2.2.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/text v0.14.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) +) \ No newline at end of file diff --git a/sh/go.test.sh b/sh/go.test.sh index 8b04db2..15bd445 100755 --- a/sh/go.test.sh +++ b/sh/go.test.sh @@ -12,12 +12,22 @@ golist() { go list ./... | grep -v mock | grep -v internal/ } +verlte() { + printf '%s\n%s' "$1" "$2" | sort -C -V +} + gotest() { cd $driver - go test -mod=readonly -race $(golist) "$@" + local go_mod_ver=$(sed -En 's/^go (.*)$/\1/p' go.mod) + local go_ver=$(go1.16 version | sed -n 's/.*go\([0-9.]*\).*/\1/p') - local exit_code=$? + local exit_code=0 + if verlte $go_mod_ver $go_ver; then + + go1.16 test -race -mod=readonly $(golist) "$@" + exit_code=$? + fi cd $ROOT