From c398a85105a3ef58a96cfc89d42efe657376367e Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 31 Dec 2024 08:59:54 +0100 Subject: [PATCH 1/4] linting fixes --- depinject/go.mod | 2 +- errors/go.mod | 2 +- log/bench_test.go | 3 --- log/go.mod | 2 +- math/go.mod | 2 +- math/legacy_dec_test.go | 1 - tests/integration/v2/example/example_test.go | 9 +++++---- 7 files changed, 9 insertions(+), 12 deletions(-) diff --git a/depinject/go.mod b/depinject/go.mod index e1b55ecbcd5..4e4274eba48 100644 --- a/depinject/go.mod +++ b/depinject/go.mod @@ -1,6 +1,6 @@ module cosmossdk.io/depinject -go 1.21 +go 1.22 require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 diff --git a/errors/go.mod b/errors/go.mod index f057227f20a..24e095e7af2 100644 --- a/errors/go.mod +++ b/errors/go.mod @@ -2,4 +2,4 @@ module cosmossdk.io/errors/v2 // NOTE: this go.mod should have zero dependencies. -go 1.20 +go 1.22 diff --git a/log/bench_test.go b/log/bench_test.go index 0005e9c1210..fdf5fca645e 100644 --- a/log/bench_test.go +++ b/log/bench_test.go @@ -83,7 +83,6 @@ func BenchmarkLoggers(b *testing.B) { // so that real write time is negligible. b.Run("zerolog", func(b *testing.B) { for _, bc := range benchCases { - bc := bc b.Run(bc.name, func(b *testing.B) { zl := zerolog.New(io.Discard) logger := log.NewCustomLogger(zl) @@ -99,7 +98,6 @@ func BenchmarkLoggers(b *testing.B) { // also useful as a reference for how expensive zerolog is. b.Run("specialized nop logger", func(b *testing.B) { for _, bc := range nopCases { - bc := bc b.Run(bc.name, func(b *testing.B) { logger := log.NewNopLogger() @@ -115,7 +113,6 @@ func BenchmarkLoggers(b *testing.B) { // so we offer the specialized version in the exported API. b.Run("zerolog nop logger", func(b *testing.B) { for _, bc := range nopCases { - bc := bc b.Run(bc.name, func(b *testing.B) { logger := log.NewCustomLogger(zerolog.Nop()) diff --git a/log/go.mod b/log/go.mod index 2ade9119ab2..b96fc35696a 100644 --- a/log/go.mod +++ b/log/go.mod @@ -1,6 +1,6 @@ module cosmossdk.io/log -go 1.21 +go 1.22 require ( github.com/bytedance/sonic v1.12.6 diff --git a/math/go.mod b/math/go.mod index 2afb0109af6..eb114e98715 100644 --- a/math/go.mod +++ b/math/go.mod @@ -1,6 +1,6 @@ module cosmossdk.io/math -go 1.20 +go 1.22 require ( github.com/cockroachdb/apd/v3 v3.2.1 diff --git a/math/legacy_dec_test.go b/math/legacy_dec_test.go index 4f3897a0867..1f0b288a080 100644 --- a/math/legacy_dec_test.go +++ b/math/legacy_dec_test.go @@ -754,7 +754,6 @@ func TestFormatDecNonDigits(t *testing.T) { } for _, value := range badCases { - value := value t.Run(value, func(t *testing.T) { s, err := math.FormatDec(value) if err == nil { diff --git a/tests/integration/v2/example/example_test.go b/tests/integration/v2/example/example_test.go index 6136d8c2c00..0f2fd4513dc 100644 --- a/tests/integration/v2/example/example_test.go +++ b/tests/integration/v2/example/example_test.go @@ -22,12 +22,13 @@ import ( // Example shows how to use the integration test framework to test the integration of SDK modules. // Panics are used in this example, but in a real test case, you should use the testing.T object and assertions. -func Example(t *testing.T) { +func Example() { + // example functions should not take any arguments, t is created in the function to avoid passing it + // in your code pass t to the integration test function + t := &testing.T{} authority := authtypes.NewModuleAddress("gov").String() - var ( - mintKeeper *mintkeeper.Keeper - ) + var mintKeeper *mintkeeper.Keeper moduleConfigs := []configurator.ModuleOption{ configurator.AccountsModule(), From 338d1bd6850e5512993ced9b216398241bfdd2b9 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 31 Dec 2024 09:20:25 +0100 Subject: [PATCH 2/4] go mod tidy --- math/go.sum | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/math/go.sum b/math/go.sum index 03e94d3c99c..86b231d55d5 100644 --- a/math/go.sum +++ b/math/go.sum @@ -7,11 +7,13 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.9/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/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/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -29,6 +31,7 @@ golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= @@ -37,6 +40,7 @@ google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6h google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= From 4c09eee97b6a55ba54e804a65d03e5e4b5ffae8d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 31 Dec 2024 09:53:44 +0100 Subject: [PATCH 3/4] fix ci tests --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9878ca45fb2..629b0ef6f8c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -283,7 +283,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" check-latest: false cache: true cache-dependency-path: depinject/go.sum @@ -312,7 +312,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" check-latest: true cache: true cache-dependency-path: errors/go.sum @@ -343,7 +343,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" check-latest: true cache: true cache-dependency-path: math/go.sum From 18dee22359293a14b9ae2cb3905e6e8eb432dcb8 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 31 Dec 2024 10:00:40 +0100 Subject: [PATCH 4/4] revert lint issue --- tests/integration/v2/example/example_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/integration/v2/example/example_test.go b/tests/integration/v2/example/example_test.go index 0f2fd4513dc..c2791502803 100644 --- a/tests/integration/v2/example/example_test.go +++ b/tests/integration/v2/example/example_test.go @@ -22,10 +22,7 @@ import ( // Example shows how to use the integration test framework to test the integration of SDK modules. // Panics are used in this example, but in a real test case, you should use the testing.T object and assertions. -func Example() { - // example functions should not take any arguments, t is created in the function to avoid passing it - // in your code pass t to the integration test function - t := &testing.T{} +func Example(t *testing.T) { authority := authtypes.NewModuleAddress("gov").String() var mintKeeper *mintkeeper.Keeper