Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Fix warnings from gosec (G601: Implicit memory aliasing in for loop.)
Browse files Browse the repository at this point in the history
  • Loading branch information
foxytanuki committed Dec 19, 2023
1 parent 0d2b04a commit 01a16de
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 11 deletions.
3 changes: 2 additions & 1 deletion x/epochs/keeper/epoch_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ func createNEpochInfo(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Epo
func TestEpochInfoGet(t *testing.T) {
keeper, ctx := keepertest.EpochsKeeper(t)
items := createNEpochInfo(keeper, ctx, 10)
for _, item := range items {
for i := range items {
item := items[i]
rst, found := keeper.GetEpochInfo(ctx,
item.Identifier,
)
Expand Down
3 changes: 2 additions & 1 deletion x/furnace/client/cli/query_burn_amount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func TestShowBurnAmount(t *testing.T) {
err: status.Error(codes.NotFound, "not found"),
},
}
for _, tc := range tests {
for i := range tests {
tc := tests[i]
t.Run(tc.desc, func(t *testing.T) {
args := []string{
strconv.Itoa(int(tc.idIndex)),
Expand Down
3 changes: 2 additions & 1 deletion x/furnace/keeper/burn_amount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ func createNBurnAmount(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Bu
func TestBurnAmountGet(t *testing.T) {
keeper, ctx := keepertest.FurnaceKeeper(t)
items := createNBurnAmount(keeper, ctx, 10)
for _, item := range items {
for i := range items {
item := items[i]
rst, found := keeper.GetBurnAmount(ctx,
item.Index,
)
Expand Down
6 changes: 4 additions & 2 deletions x/registry/client/cli/query_domain_ownership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestShowDomainOwnership(t *testing.T) {
common := []string{
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
}
for _, tc := range []struct {
tests := []struct {
desc string
idOwner string

Expand All @@ -71,7 +71,9 @@ func TestShowDomainOwnership(t *testing.T) {
args: common,
err: status.Error(codes.NotFound, "not found"),
},
} {
}
for i := range tests {
tc := tests[i]
t.Run(tc.desc, func(t *testing.T) {
args := []string{
tc.idOwner,
Expand Down
6 changes: 4 additions & 2 deletions x/registry/client/cli/query_second_level_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestShowSecondLevelDomain(t *testing.T) {
common := []string{
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
}
for _, tc := range []struct {
tests := []struct {
desc string
idName string
idParent string
Expand All @@ -84,7 +84,9 @@ func TestShowSecondLevelDomain(t *testing.T) {
args: common,
err: status.Error(codes.NotFound, "not found"),
},
} {
}
for i := range tests {
tc := tests[i]
t.Run(tc.desc, func(t *testing.T) {
args := []string{
tc.idName,
Expand Down
3 changes: 2 additions & 1 deletion x/registry/client/cli/query_top_level_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ func TestShowTopLevelDomain(t *testing.T) {
err: status.Error(codes.NotFound, "not found"),
},
}
for _, tc := range tests {
for i := range tests {
tc := tests[i]
t.Run(tc.desc, func(t *testing.T) {
args := []string{
tc.idName,
Expand Down
3 changes: 2 additions & 1 deletion x/registry/keeper/domain_ownership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ func createNDomainOwnership(keeper *keeper.Keeper, ctx sdk.Context, n int) []typ
func TestDomainOwnershipGet(t *testing.T) {
keeper, ctx := keepertest.RegistryKeeper(t)
items := createNDomainOwnership(keeper, ctx, 10)
for _, item := range items {
for i := range items {
item := items[i]
rst, found := keeper.GetDomainOwnership(ctx,
item.Owner,
)
Expand Down
3 changes: 2 additions & 1 deletion x/registry/keeper/second_level_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ func registerNSecondLevelDomain(k *keeper.Keeper, ctx sdk.Context, creatorAddr s
func TestSecondLevelDomainGet(t *testing.T) {
keeper, ctx := keepertest.RegistryKeeper(t)
items := createNSecondLevelDomain(keeper, ctx, 10)
for _, item := range items {
for i := range items {
item := items[i]
rst, found := keeper.GetSecondLevelDomain(ctx,
item.Name,
item.Parent,
Expand Down
3 changes: 2 additions & 1 deletion x/registry/keeper/top_level_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ func registerNTopLevelDomain(k *keeper.Keeper, ctx sdk.Context, creatorAddr stri
func TestTopLevelDomainGet(t *testing.T) {
keeper, ctx := keepertest.RegistryKeeper(t)
items := createNTopLevelDomain(keeper, ctx, 10)
for _, item := range items {
for i := range items {
item := items[i]
rst, found := keeper.GetTopLevelDomain(ctx,
item.Name,
)
Expand Down

0 comments on commit 01a16de

Please sign in to comment.