From 4ac835d7a2a865503a7a29a90b8c386b8e7c3d5c Mon Sep 17 00:00:00 2001 From: bayge Date: Mon, 15 Jul 2024 11:12:58 +0930 Subject: [PATCH] Don't capture i accidentally --- lib/config/pools.go | 4 ++-- lib/math/concentrated-liq_test.go | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/config/pools.go b/lib/config/pools.go index 90d8d9ab..156b6e81 100644 --- a/lib/config/pools.go +++ b/lib/config/pools.go @@ -4,6 +4,6 @@ import "github.com/fluidity-money/long.so/lib/types/seawater" // Pool config, probably derived from config/pools.toml. type Pool struct { - Displayed bool `toml:"displayed",json:"displayed"` - Classification seawater.Classification `toml:"classification",json:"classification"` + Displayed bool `toml:"displayed" json:"displayed"` + Classification seawater.Classification `toml:"classification" json:"classification"` } diff --git a/lib/math/concentrated-liq_test.go b/lib/math/concentrated-liq_test.go index a38916ed..4e1bc0d5 100644 --- a/lib/math/concentrated-liq_test.go +++ b/lib/math/concentrated-liq_test.go @@ -123,7 +123,12 @@ func TestGetAmountsForLiq(t *testing.T) { test := test t.Run(k, func(t *testing.T) { t.Parallel() - amount0, amount1 := GetAmountsForLiq(test.sqrtRatioX96, test.sqrtRatioAX96, test.sqrtRatioBX96, new(big.Int).SetInt64(int64(test.liq))) + amount0, amount1 := GetAmountsForLiq( + test.sqrtRatioX96, + test.sqrtRatioAX96, + test.sqrtRatioBX96, + new(big.Int).SetInt64(int64(test.liq)), + ) assertOneDiff(t, test.expectedAmount0, amount0, "amount0 is wrong") assertOneDiff(t, test.expectedAmount1, amount1, "amount1 is wrong") }) @@ -4953,6 +4958,7 @@ var getAmountsForLiqLiveTestTable = []struct { func TestGetAmountsForLiqLive(t *testing.T) { for i, test := range getAmountsForLiqLiveTestTable { + i := i test := test t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel() @@ -6627,6 +6633,7 @@ var getIndividualAmountsForLiquidityTestTable = []struct { func TestGetIndividualAmountsForLiquidity(t *testing.T) { for i, test := range getIndividualAmountsForLiquidityTestTable { + i := i test := test t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel()