From de974fc8ee04dada0d8f4867cd08ccc6cdf6d65d Mon Sep 17 00:00:00 2001 From: Stanislav Gaydin Date: Fri, 27 Dec 2024 14:45:46 +0700 Subject: [PATCH 1/4] Update go, linter versions and update dependencies --- .github/workflows/ci-build.yml | 2 +- .github/workflows/golangci-lint.yml | 4 +- Dockerfile | 2 +- Makefile | 2 +- README-ru.md | 2 +- README.md | 2 +- fixtures/aerospike/aerospike.go | 3 +- fixtures/aerospike/aerospike_test.go | 4 +- fixtures/mysql/mysql.go | 3 +- fixtures/mysql/mysql_test.go | 8 +- fixtures/postgres/postgres.go | 5 +- fixtures/postgres/postgres_test.go | 10 +- fixtures/redis/parser/yaml.go | 4 +- fixtures/redis/redis.go | 2 +- go.mod | 53 ++++++---- go.sum | 147 ++++++++++++--------------- main.go | 2 +- mocks/reply_strategy.go | 4 +- testloader/yaml_file/parser.go | 4 +- testloader/yaml_file/test.go | 2 +- 20 files changed, 129 insertions(+), 136 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index afd85d0..8f4f2ca 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - go: ['1.13.x', '1.14.x', '1.15.x', '1.16.x', '1.17.x'] + go: ['1.20.x', '1.21.x', '1.23.x'] steps: - name: Set up Go diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 11cd4b7..3439471 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -17,9 +17,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.21" + go-version: "1.23" cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.55.1 + version: v1.62.2 diff --git a/Dockerfile b/Dockerfile index d79c453..3f643e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.14 as build +FROM golang:1.23 as build ENV GOOS linux ENV GOARCH amd64 diff --git a/Makefile b/Makefile index c280621..d156261 100644 --- a/Makefile +++ b/Makefile @@ -26,4 +26,4 @@ test: go test ./... lint: - docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.55.1 golangci-lint run -v \ No newline at end of file + docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.62.2 golangci-lint run -v \ No newline at end of file diff --git a/README-ru.md b/README-ru.md index 8794419..87e211d 100644 --- a/README-ru.md +++ b/README-ru.md @@ -151,7 +151,7 @@ import ( "github.com/lamoda/gonkey/fixtures" redisLoader "github.com/lamoda/gonkey/fixtures/redis" // redisLoader "custom_module/gonkey-redis" // внешняя библиотека, содержащая реализацию интерфейса fixtures.Loader - redisClient "github.com/go-redis/redis/v9" + redisClient "github.com/redis/go-redis/v9" "github.com/lamoda/gonkey/runner" ) diff --git a/README.md b/README.md index 34ae68a..1cda5f8 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ import ( "github.com/lamoda/gonkey/fixtures" redisLoader "github.com/lamoda/gonkey/fixtures/redis" // redisLoader "custom_module/gonkey-redis" // custom implementation of a fixtures.Loader interface - redisClient "github.com/go-redis/redis/v9" + redisClient "github.com/redis/go-redis/v9" "github.com/lamoda/gonkey/runner" ) diff --git a/fixtures/aerospike/aerospike.go b/fixtures/aerospike/aerospike.go index 4f994eb..e08c31e 100644 --- a/fixtures/aerospike/aerospike.go +++ b/fixtures/aerospike/aerospike.go @@ -4,7 +4,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "gopkg.in/yaml.v2" @@ -91,7 +90,7 @@ func (l *LoaderAerospike) loadFile(name string, ctx *loadContext) error { if l.debug { fmt.Println("Loading", file) } - data, err := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { return err } diff --git a/fixtures/aerospike/aerospike_test.go b/fixtures/aerospike/aerospike_test.go index 6fd71f3..d3a5529 100644 --- a/fixtures/aerospike/aerospike_test.go +++ b/fixtures/aerospike/aerospike_test.go @@ -1,7 +1,7 @@ package aerospike import ( - "io/ioutil" + "os" "testing" "github.com/stretchr/testify/require" @@ -114,7 +114,7 @@ func TestLoaderAerospike_loadYml(t *testing.T) { } func loadTestData(t *testing.T, path string) []byte { - aerospikeYaml, err := ioutil.ReadFile(path) + aerospikeYaml, err := os.ReadFile(path) if err != nil { t.Error("No aerospike.yaml") } diff --git a/fixtures/mysql/mysql.go b/fixtures/mysql/mysql.go index cfbb24f..1ab6bbe 100644 --- a/fixtures/mysql/mysql.go +++ b/fixtures/mysql/mysql.go @@ -5,7 +5,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "regexp" "sort" @@ -100,7 +99,7 @@ func (l *LoaderMysql) loadFile(name string, ctx *loadContext) error { l.printDebug("Loading", file) - data, err := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { return err } diff --git a/fixtures/mysql/mysql_test.go b/fixtures/mysql/mysql_test.go index 4727d0f..fe88f04 100644 --- a/fixtures/mysql/mysql_test.go +++ b/fixtures/mysql/mysql_test.go @@ -4,7 +4,7 @@ import ( "database/sql" "database/sql/driver" "fmt" - "io/ioutil" + "os" "strings" "testing" @@ -15,7 +15,7 @@ import ( func TestBuildInsertQuery(t *testing.T) { - ymlFile, err := ioutil.ReadFile("../testdata/sql.yaml") + ymlFile, err := os.ReadFile("../testdata/sql.yaml") require.NoError(t, err) expected := []string{ @@ -45,7 +45,7 @@ func TestBuildInsertQuery(t *testing.T) { } func TestLoadTablesShouldResolveRefs(t *testing.T) { - yml, err := ioutil.ReadFile("../testdata/sql_refs.yaml") + yml, err := os.ReadFile("../testdata/sql_refs.yaml") require.NoError(t, err) db, mock, err := sqlmock.New() @@ -111,7 +111,7 @@ func TestLoadTablesShouldResolveRefs(t *testing.T) { } func TestLoadTablesShouldExtendRows(t *testing.T) { - yml, err := ioutil.ReadFile("../testdata/sql_extend.yaml") + yml, err := os.ReadFile("../testdata/sql_extend.yaml") require.NoError(t, err) db, mock, err := sqlmock.New() diff --git a/fixtures/postgres/postgres.go b/fixtures/postgres/postgres.go index 565201c..58c0eae 100644 --- a/fixtures/postgres/postgres.go +++ b/fixtures/postgres/postgres.go @@ -5,7 +5,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "regexp" "sort" @@ -117,7 +116,7 @@ func (f *LoaderPostgres) loadFile(name string, ctx *loadContext) error { if f.debug { fmt.Println("Loading", file) } - data, err := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { return err } @@ -403,7 +402,7 @@ func (f *LoaderPostgres) buildInsertQuery(ctx *loadContext, t tableName, rows ta } // resolve references if stringValue, ok := value.(string); ok { - if len(stringValue) > 0 && stringValue[0] == '$' { + if stringValue != "" && stringValue[0] == '$' { var err error dbValuesRow[k], err = f.resolveExpression(stringValue, ctx) if err != nil { diff --git a/fixtures/postgres/postgres_test.go b/fixtures/postgres/postgres_test.go index 985e535..2adea15 100644 --- a/fixtures/postgres/postgres_test.go +++ b/fixtures/postgres/postgres_test.go @@ -2,7 +2,7 @@ package postgres import ( "database/sql" - "io/ioutil" + "os" "testing" "github.com/stretchr/testify/require" @@ -10,7 +10,7 @@ import ( ) func TestBuildInsertQuery(t *testing.T) { - yml, err := ioutil.ReadFile("../testdata/sql.yaml") + yml, err := os.ReadFile("../testdata/sql.yaml") require.NoError(t, err) expected := "INSERT INTO \"public\".\"table\" AS row (\"field1\", \"field2\", \"field3\", \"field4\", \"field5\") VALUES " + @@ -36,7 +36,7 @@ func TestBuildInsertQuery(t *testing.T) { } func TestLoadTablesShouldResolveSchema(t *testing.T) { - yml, err := ioutil.ReadFile("../testdata/sql_schema.yaml") + yml, err := os.ReadFile("../testdata/sql_schema.yaml") require.NoError(t, err) db, mock, err := sqlmock.New() @@ -101,7 +101,7 @@ func TestLoadTablesShouldResolveSchema(t *testing.T) { } func TestLoadTablesShouldResolveRefs(t *testing.T) { - yml, err := ioutil.ReadFile("../testdata/sql_refs.yaml") + yml, err := os.ReadFile("../testdata/sql_refs.yaml") require.NoError(t, err) db, mock, err := sqlmock.New() @@ -166,7 +166,7 @@ func TestLoadTablesShouldResolveRefs(t *testing.T) { } func TestLoadTablesShouldExtendRows(t *testing.T) { - yml, err := ioutil.ReadFile("../testdata/sql_extend.yaml") + yml, err := os.ReadFile("../testdata/sql_extend.yaml") require.NoError(t, err) db, mock, err := sqlmock.New() diff --git a/fixtures/redis/parser/yaml.go b/fixtures/redis/parser/yaml.go index 27a4364..4b08253 100644 --- a/fixtures/redis/parser/yaml.go +++ b/fixtures/redis/parser/yaml.go @@ -3,7 +3,7 @@ package parser import ( "errors" "fmt" - "io/ioutil" + "os" "gopkg.in/yaml.v3" ) @@ -466,7 +466,7 @@ func (p *redisYamlParser) buildZSets(ctx *Context, data *ZSets) error { } func (p *redisYamlParser) Parse(ctx *Context, filename string) (*Fixture, error) { - data, err := ioutil.ReadFile(filename) + data, err := os.ReadFile(filename) if err != nil { return nil, err } diff --git a/fixtures/redis/redis.go b/fixtures/redis/redis.go index a13ae50..fb0d536 100644 --- a/fixtures/redis/redis.go +++ b/fixtures/redis/redis.go @@ -3,8 +3,8 @@ package redis import ( "context" - "github.com/go-redis/redis/v9" "github.com/lamoda/gonkey/fixtures/redis/parser" + "github.com/redis/go-redis/v9" ) type Loader struct { diff --git a/go.mod b/go.mod index 2337eb2..2bc77c3 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,45 @@ module github.com/lamoda/gonkey -go 1.14 +go 1.21 require ( - github.com/Masterminds/sprig/v3 v3.2.2 - github.com/aerospike/aerospike-client-go/v5 v5.8.0 - github.com/fatih/color v1.7.0 - github.com/go-redis/redis/v9 v9.0.0-beta.2 + github.com/Masterminds/sprig/v3 v3.3.0 + github.com/aerospike/aerospike-client-go/v5 v5.11.0 + github.com/fatih/color v1.18.0 github.com/google/go-cmp v0.6.0 - github.com/google/uuid v1.3.1 - github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.13 // indirect - github.com/joho/godotenv v1.3.0 + github.com/google/uuid v1.6.0 + github.com/joho/godotenv v1.5.1 github.com/kylelemons/godebug v1.1.0 - github.com/lib/pq v1.3.0 - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/stretchr/testify v1.7.1 - github.com/tidwall/gjson v1.17.0 - github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect - golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect - golang.org/x/sync v0.4.0 + github.com/lib/pq v1.10.9 + github.com/redis/go-redis/v9 v9.7.0 + github.com/stretchr/testify v1.10.0 + github.com/tidwall/gjson v1.18.0 + golang.org/x/sync v0.10.0 gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) + +require ( + dario.cat/mergo v1.0.1 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.3.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/huandu/xstrings v1.5.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect + github.com/onsi/gomega v1.24.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/shopspring/decimal v1.4.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.1 // indirect + github.com/yuin/gopher-lua v1.1.1 // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/sys v0.28.0 // indirect +) diff --git a/go.sum b/go.sum index 980aa5d..a35acdc 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,19 @@ +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/aerospike/aerospike-client-go/v5 v5.8.0 h1:EUV2wG80yIenQqOyUlf5NfyhagPIwoeL09MJIE+xILE= -github.com/aerospike/aerospike-client-go/v5 v5.8.0/go.mod h1:rJ/KpmClE7kiBPfvAPrGw9WuNOiz8v2uKbQaUyYPXtI= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= +github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= +github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= +github.com/aerospike/aerospike-client-go/v5 v5.11.0 h1:z3ZmDSm3I10VMXXIIrsFCFq3IenwFqTCnLNyvnFVzrk= +github.com/aerospike/aerospike-client-go/v5 v5.11.0/go.mod h1:e/zYeIoBg9We63fLKa+h+198+fT1GdoLfKa+Pu4QSpg= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -16,13 +22,13 @@ 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/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/go-redis/redis/v9 v9.0.0-beta.2 h1:ZSr84TsnQyKMAg8gnV+oawuQezeJR11/09THcWCQzr4= -github.com/go-redis/redis/v9 v9.0.0-beta.2/go.mod h1:Bldcd/M/bm9HbnNPi/LUtYBSD8ttcZYBMupwMXhdU0o= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -32,42 +38,35 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 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/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -78,69 +77,60 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= +github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= 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/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= +github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= -github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= 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-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -148,7 +138,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -156,28 +145,22 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -190,8 +173,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 h1:FVCohIoYO7IJoDDVpV2pdq7SgrMH6wHnuTyrdrxJNoY= gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= @@ -204,7 +185,5 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/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/main.go b/main.go index d8797b2..7549afb 100644 --- a/main.go +++ b/main.go @@ -11,8 +11,8 @@ import ( "strings" "github.com/aerospike/aerospike-client-go/v5" - "github.com/go-redis/redis/v9" "github.com/joho/godotenv" + "github.com/redis/go-redis/v9" "github.com/lamoda/gonkey/checker/response_body" "github.com/lamoda/gonkey/checker/response_db" diff --git a/mocks/reply_strategy.go b/mocks/reply_strategy.go index 74366ac..f76db59 100644 --- a/mocks/reply_strategy.go +++ b/mocks/reply_strategy.go @@ -2,9 +2,9 @@ package mocks import ( "fmt" - "io/ioutil" "net/http" "net/http/httputil" + "os" "strings" "sync" ) @@ -33,7 +33,7 @@ func unhandledRequestError(r *http.Request) []error { } func NewFileReplyWithCode(filename string, statusCode int, headers map[string]string) (ReplyStrategy, error) { - content, err := ioutil.ReadFile(filename) + content, err := os.ReadFile(filename) if err != nil { return nil, err } diff --git a/testloader/yaml_file/parser.go b/testloader/yaml_file/parser.go index 0e9f2cf..6b30421 100644 --- a/testloader/yaml_file/parser.go +++ b/testloader/yaml_file/parser.go @@ -3,7 +3,7 @@ package yaml_file import ( "bytes" "fmt" - "io/ioutil" + "os" "regexp" "strings" "text/template" @@ -21,7 +21,7 @@ const ( var gonkeyProtectTemplate = regexp.MustCompile(`{{\s*\$`) func parseTestDefinitionFile(absPath string) ([]Test, error) { - data, err := ioutil.ReadFile(absPath) + data, err := os.ReadFile(absPath) if err != nil { return nil, fmt.Errorf("failed to read file %s:\n%s", absPath, err) } diff --git a/testloader/yaml_file/test.go b/testloader/yaml_file/test.go index 87b226f..1d3371e 100644 --- a/testloader/yaml_file/test.go +++ b/testloader/yaml_file/test.go @@ -179,7 +179,7 @@ func (t *Test) Clone() models.TestInterface { func (t *Test) SetQuery(val string) { var query strings.Builder query.Grow(len(val) + 1) - if len(val) > 0 && val[0] != '?' { + if val != "" && val[0] != '?' { query.WriteString("?") } query.WriteString(val) From 210bc17b530dae6ab8975b6a9835fcca333e5885 Mon Sep 17 00:00:00 2001 From: Stanislav Gaydin Date: Fri, 27 Dec 2024 14:49:29 +0700 Subject: [PATCH 2/4] Use only last two go version --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 8f4f2ca..8ad0579 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - go: ['1.20.x', '1.21.x', '1.23.x'] + go: ['1.21.x', '1.23.x'] steps: - name: Set up Go From 2711697302a83c486f6ea30569849e7948efc8d7 Mon Sep 17 00:00:00 2001 From: Stanislav Gaydin Date: Fri, 27 Dec 2024 15:02:15 +0700 Subject: [PATCH 3/4] Linter issues fixed --- .golangci.yml | 23 +++++++++++++------ checker/addons/openapi2_compliance/checker.go | 6 ++--- checker/response_db/response_db.go | 6 ++--- .../response_header/response_header_test.go | 4 ++-- examples/mock-based-on-request/main.go | 3 +-- examples/mock-field-json-str/main.go | 4 ++-- examples/traffic-lights-demo/main.go | 4 ++-- examples/with-cases-example/main.go | 4 ++-- fixtures/postgres/postgres.go | 2 +- fixtures/redis/redis.go | 3 ++- mocks/request_constraint.go | 21 +++++++++-------- output/allure_report/allure.go | 7 +++--- output/console_colored/console_colored.go | 1 + runner/request.go | 3 +-- runner/runner.go | 4 ++-- runner/runner_upload_file_test.go | 4 ++-- testloader/yaml_file/parser.go | 4 ++-- testloader/yaml_file/parser_test.go | 3 +-- testloader/yaml_file/yaml_file.go | 13 +++++++---- 19 files changed, 67 insertions(+), 52 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 69ce224..8ad5494 100755 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,13 +1,13 @@ -service: - golangci-lint-version: v1.55.1 - run: tests: false - skip-dirs: + +issues: + exclude-files: + - ".*easyjson\\.go$" + exclude-dirs: - allure - mocks - skip-files: - - ".*easyjson\\.go$" + output: print-issued-lines: false @@ -32,6 +32,14 @@ linters-settings: # Should be enabled after fixing underscore package names. - name: var-naming disabled: true + gci: + sections: + - standard + - default + - prefix(github.com/lamoda/gonkey) + skip-generated: true + custom-order: false + no-lex-order: false linters: enable: @@ -58,4 +66,5 @@ linters: - unconvert - unparam - unused - - gas + - gosec + - gci diff --git a/checker/addons/openapi2_compliance/checker.go b/checker/addons/openapi2_compliance/checker.go index 5e2de35..a116de8 100644 --- a/checker/addons/openapi2_compliance/checker.go +++ b/checker/addons/openapi2_compliance/checker.go @@ -4,14 +4,14 @@ import ( "encoding/json" "strings" - "github.com/lamoda/gonkey/checker" - "github.com/lamoda/gonkey/models" - "github.com/go-openapi/errors" "github.com/go-openapi/loads" "github.com/go-openapi/spec" "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" + + "github.com/lamoda/gonkey/checker" + "github.com/lamoda/gonkey/models" ) type ResponseSchemaChecker struct { diff --git a/checker/response_db/response_db.go b/checker/response_db/response_db.go index d7108cb..49ee8ab 100644 --- a/checker/response_db/response_db.go +++ b/checker/response_db/response_db.go @@ -6,12 +6,12 @@ import ( "fmt" "strings" + "github.com/fatih/color" + "github.com/kylelemons/godebug/pretty" + "github.com/lamoda/gonkey/checker" "github.com/lamoda/gonkey/compare" "github.com/lamoda/gonkey/models" - - "github.com/fatih/color" - "github.com/kylelemons/godebug/pretty" ) type ResponseDbChecker struct { diff --git a/checker/response_header/response_header_test.go b/checker/response_header/response_header_test.go index 7615122..16feb07 100644 --- a/checker/response_header/response_header_test.go +++ b/checker/response_header/response_header_test.go @@ -5,10 +5,10 @@ import ( "sort" "testing" + "github.com/stretchr/testify/assert" + "github.com/lamoda/gonkey/models" "github.com/lamoda/gonkey/testloader/yaml_file" - - "github.com/stretchr/testify/assert" ) func TestCheckShouldMatchSubset(t *testing.T) { diff --git a/examples/mock-based-on-request/main.go b/examples/mock-based-on-request/main.go index d1ff819..4067550 100755 --- a/examples/mock-based-on-request/main.go +++ b/examples/mock-based-on-request/main.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "log" "net/http" urlpkg "net/url" @@ -45,7 +44,7 @@ func Do(w http.ResponseWriter, r *http.Request) { if res.StatusCode != http.StatusOK { return 0, fmt.Errorf("backend response status code %d", res.StatusCode) } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) _ = res.Body.Close() if err != nil { return 0, fmt.Errorf("cannot read response body %w", err) diff --git a/examples/mock-field-json-str/main.go b/examples/mock-field-json-str/main.go index c034cb6..97b2a33 100644 --- a/examples/mock-field-json-str/main.go +++ b/examples/mock-field-json-str/main.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -20,7 +20,7 @@ func initServer() { } func ProxyRequest(w http.ResponseWriter, r *http.Request) { - body, err := ioutil.ReadAll(r.Body) + body, err := io.ReadAll(r.Body) if err != nil { log.Print(err) w.Write([]byte("{\"status\": \"error\"}")) diff --git a/examples/traffic-lights-demo/main.go b/examples/traffic-lights-demo/main.go index 0113a64..c93c5f8 100644 --- a/examples/traffic-lights-demo/main.go +++ b/examples/traffic-lights-demo/main.go @@ -3,7 +3,7 @@ package main import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "sync" @@ -54,7 +54,7 @@ func initServer() { lights.mutex.Lock() defer lights.mutex.Unlock() - request, err := ioutil.ReadAll(r.Body) + request, err := io.ReadAll(r.Body) if err != nil { log.Fatal(err) } diff --git a/examples/with-cases-example/main.go b/examples/with-cases-example/main.go index ea0d576..f320cd1 100644 --- a/examples/with-cases-example/main.go +++ b/examples/with-cases-example/main.go @@ -3,7 +3,7 @@ package main import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" ) @@ -34,7 +34,7 @@ func Do(w http.ResponseWriter, r *http.Request) { return } - jsonRequest, _ := ioutil.ReadAll(r.Body) + jsonRequest, _ := io.ReadAll(r.Body) request := buildRequest(jsonRequest) if request.Name == "a" { diff --git a/fixtures/postgres/postgres.go b/fixtures/postgres/postgres.go index 58c0eae..310a7ce 100644 --- a/fixtures/postgres/postgres.go +++ b/fixtures/postgres/postgres.go @@ -379,7 +379,7 @@ func (f *LoaderPostgres) buildInsertQuery(ctx *loadContext, t tableName, rows ta fieldPresence := make(map[string]bool) for _, row := range rows { for name := range row { - if len(name) > 0 && name[0] == '$' { + if name != "" && name[0] == '$' { continue } if _, ok := fieldPresence[name]; !ok { diff --git a/fixtures/redis/redis.go b/fixtures/redis/redis.go index fb0d536..2d34bb8 100644 --- a/fixtures/redis/redis.go +++ b/fixtures/redis/redis.go @@ -3,8 +3,9 @@ package redis import ( "context" - "github.com/lamoda/gonkey/fixtures/redis/parser" "github.com/redis/go-redis/v9" + + "github.com/lamoda/gonkey/fixtures/redis/parser" ) type Loader struct { diff --git a/mocks/request_constraint.go b/mocks/request_constraint.go index 42faba7..bc8792c 100644 --- a/mocks/request_constraint.go +++ b/mocks/request_constraint.go @@ -5,7 +5,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "reflect" @@ -13,9 +13,10 @@ import ( "sort" "strings" + "github.com/tidwall/gjson" + "github.com/lamoda/gonkey/compare" "github.com/lamoda/gonkey/xmlparsing" - "github.com/tidwall/gjson" ) type verifier interface { @@ -47,12 +48,12 @@ func newBodyMatchesXMLConstraint(expected string, params compare.Params) (verifi } func (c *bodyMatchesXMLConstraint) Verify(r *http.Request) []error { - body, err := ioutil.ReadAll(r.Body) + body, err := io.ReadAll(r.Body) if err != nil { return []error{err} } // write body for future reusing - r.Body = ioutil.NopCloser(bytes.NewReader(body)) + r.Body = io.NopCloser(bytes.NewReader(body)) if len(body) == 0 { return []error{errors.New("request is empty")} } @@ -84,12 +85,12 @@ func newBodyMatchesJSONConstraint(expected string, params compare.Params) (verif } func (c *bodyMatchesJSONConstraint) Verify(r *http.Request) []error { - body, err := ioutil.ReadAll(r.Body) + body, err := io.ReadAll(r.Body) if err != nil { return []error{err} } // write body for future reusing - r.Body = ioutil.NopCloser(bytes.NewReader(body)) + r.Body = io.NopCloser(bytes.NewReader(body)) if len(body) == 0 { return []error{errors.New("request is empty")} } @@ -122,13 +123,13 @@ func newBodyJSONFieldMatchesJSONConstraint(path, expected string, params compare } func (c *bodyJSONFieldMatchesJSONConstraint) Verify(r *http.Request) []error { - body, err := ioutil.ReadAll(r.Body) + body, err := io.ReadAll(r.Body) if err != nil { return []error{err} } // write body for future reusing - r.Body = ioutil.NopCloser(bytes.NewReader(body)) + r.Body = io.NopCloser(bytes.NewReader(body)) value := gjson.Get(string(body), c.path) if !value.Exists() { @@ -338,13 +339,13 @@ func newBodyMatchesTextConstraint(body, re string) (verifier, error) { } func (c *bodyMatchesTextConstraint) Verify(r *http.Request) []error { - ioBody, err := ioutil.ReadAll(r.Body) + ioBody, err := io.ReadAll(r.Body) if err != nil { return []error{err} } // write body for future reusing - r.Body = ioutil.NopCloser(bytes.NewReader(ioBody)) + r.Body = io.NopCloser(bytes.NewReader(ioBody)) body := string(ioBody) diff --git a/output/allure_report/allure.go b/output/allure_report/allure.go index 7770af7..f21c606 100644 --- a/output/allure_report/allure.go +++ b/output/allure_report/allure.go @@ -4,11 +4,12 @@ import ( "bytes" "encoding/xml" "errors" - "io/ioutil" + "os" "path/filepath" "time" "github.com/google/uuid" + "github.com/lamoda/gonkey/output/allure_report/beans" ) @@ -119,7 +120,7 @@ func getBufferInfo(buf bytes.Buffer, typ string) (string, string) { func writeBuffer(pathDir string, buf bytes.Buffer, ext string) (string, error) { fileName := uuid.New().String() + `-attachment.` + ext - err := ioutil.WriteFile(filepath.Join(pathDir, fileName), buf.Bytes(), 0o644) + err := os.WriteFile(filepath.Join(pathDir, fileName), buf.Bytes(), 0o644) return fileName, err } @@ -129,7 +130,7 @@ func writeSuite(pathDir string, suite *beans.Suite) error { if err != nil { return err } - err = ioutil.WriteFile(filepath.Join(pathDir, uuid.New().String()+`-testsuite.xml`), b, 0o644) + err = os.WriteFile(filepath.Join(pathDir, uuid.New().String()+`-testsuite.xml`), b, 0o644) if err != nil { return err } diff --git a/output/console_colored/console_colored.go b/output/console_colored/console_colored.go index 63e1486..5138da0 100644 --- a/output/console_colored/console_colored.go +++ b/output/console_colored/console_colored.go @@ -5,6 +5,7 @@ import ( "text/template" "github.com/fatih/color" + "github.com/lamoda/gonkey/models" ) diff --git a/runner/request.go b/runner/request.go index 9e41e8e..01b5816 100644 --- a/runner/request.go +++ b/runner/request.go @@ -5,7 +5,6 @@ import ( "crypto/tls" "fmt" "io" - "io/ioutil" "mime/multipart" "net/http" "net/url" @@ -181,7 +180,7 @@ func request(test models.TestInterface, b *bytes.Buffer, host string) (*http.Req func actualRequestBody(req *http.Request) string { if req.Body != nil { reqBodyStream, _ := req.GetBody() - reqBody, _ := ioutil.ReadAll(reqBodyStream) + reqBody, _ := io.ReadAll(reqBodyStream) return string(reqBody) } diff --git a/runner/runner.go b/runner/runner.go index 744bba8..6aa6e4e 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -3,7 +3,7 @@ package runner import ( "errors" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "strings" @@ -170,7 +170,7 @@ func (r *Runner) executeTest(v models.TestInterface) (*models.Result, error) { return nil, err } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) _ = resp.Body.Close() diff --git a/runner/runner_upload_file_test.go b/runner/runner_upload_file_test.go index 8df87a3..9daf7b6 100644 --- a/runner/runner_upload_file_test.go +++ b/runner/runner_upload_file_test.go @@ -2,7 +2,7 @@ package runner import ( "encoding/json" - "io/ioutil" + "io" "net/http" "net/http/httptest" "path/filepath" @@ -58,7 +58,7 @@ func formFile(t *testing.T, r *http.Request, field string) (string, string) { defer func() { _ = file.Close() }() - contents, err := ioutil.ReadAll(file) + contents, err := io.ReadAll(file) require.NoError(t, err) return header.Filename, string(contents) diff --git a/testloader/yaml_file/parser.go b/testloader/yaml_file/parser.go index 6b30421..23f670e 100644 --- a/testloader/yaml_file/parser.go +++ b/testloader/yaml_file/parser.go @@ -8,9 +8,9 @@ import ( "strings" "text/template" - "github.com/lamoda/gonkey/models" - "gopkg.in/yaml.v2" + + "github.com/lamoda/gonkey/models" ) const ( diff --git a/testloader/yaml_file/parser_test.go b/testloader/yaml_file/parser_test.go index d91da72..9c99d80 100644 --- a/testloader/yaml_file/parser_test.go +++ b/testloader/yaml_file/parser_test.go @@ -2,7 +2,6 @@ package yaml_file import ( "fmt" - "io/ioutil" "os" "testing" ) @@ -55,7 +54,7 @@ var testsYAMLData = ` ` func TestParseTestsWithCases(t *testing.T) { - tmpfile, err := ioutil.TempFile("../..", "tmpfile_") + tmpfile, err := os.CreateTemp("../..", "tmpfile_") if err != nil { t.Fatal(err) } diff --git a/testloader/yaml_file/yaml_file.go b/testloader/yaml_file/yaml_file.go index 5511d61..9492f37 100644 --- a/testloader/yaml_file/yaml_file.go +++ b/testloader/yaml_file/yaml_file.go @@ -1,7 +1,6 @@ package yaml_file import ( - "io/ioutil" "os" "strings" @@ -56,15 +55,21 @@ func (l *YamlFileLoader) lookupPath(path string, fi os.FileInfo) ([]Test, error) return parseTestDefinitionFile(path) } - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { return nil, err } var tests []Test - for _, fi := range files { - if !fi.IsDir() && !isYmlFile(fi.Name()) { + for _, de := range files { + if !de.IsDir() && !isYmlFile(de.Name()) { continue } + + fi, err = de.Info() + if err != nil { + return nil, err + } + moreTests, err := l.lookupPath(path+"/"+fi.Name(), fi) if err != nil { return nil, err From 0916e1d27fe569cc689e938ff066e02416d29e78 Mon Sep 17 00:00:00 2001 From: Stanislav Gaydin Date: Fri, 27 Dec 2024 15:04:08 +0700 Subject: [PATCH 4/4] Add missing go version to matrix --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 8ad0579..3324991 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - go: ['1.21.x', '1.23.x'] + go: ['1.21.x', '1.22.x', '1.23.x'] steps: - name: Set up Go