[#1459] .golangci.yml: Add intrange linter, fix issues
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
d28a5d2d7a
commit
7ac0852364
15 changed files with 24 additions and 23 deletions
|
@ -19,7 +19,7 @@ import (
|
|||
|
||||
func GeneratePayloadPool(count uint, size uint) [][]byte {
|
||||
var pool [][]byte
|
||||
for i := uint(0); i < count; i++ {
|
||||
for range count {
|
||||
payload := make([]byte, size)
|
||||
_, _ = rand.Read(payload)
|
||||
|
||||
|
@ -30,8 +30,8 @@ func GeneratePayloadPool(count uint, size uint) [][]byte {
|
|||
|
||||
func GenerateAttributePool(count uint) []objectSDK.Attribute {
|
||||
var pool []objectSDK.Attribute
|
||||
for i := uint(0); i < count; i++ {
|
||||
for j := uint(0); j < count; j++ {
|
||||
for i := range count {
|
||||
for j := range count {
|
||||
attr := *objectSDK.NewAttribute()
|
||||
attr.SetKey(fmt.Sprintf("key%d", i))
|
||||
attr.SetValue(fmt.Sprintf("value%d", j))
|
||||
|
@ -43,7 +43,7 @@ func GenerateAttributePool(count uint) []objectSDK.Attribute {
|
|||
|
||||
func GenerateOwnerPool(count uint) []user.ID {
|
||||
var pool []user.ID
|
||||
for i := uint(0); i < count; i++ {
|
||||
for range count {
|
||||
pool = append(pool, usertest.ID())
|
||||
}
|
||||
return pool
|
||||
|
@ -118,7 +118,7 @@ func WithPayloadFromPool(pool [][]byte) ObjectOption {
|
|||
func WithAttributesFromPool(pool []objectSDK.Attribute, count uint) ObjectOption {
|
||||
return func(obj *objectSDK.Object) {
|
||||
var attrs []objectSDK.Attribute
|
||||
for i := uint(0); i < count; i++ {
|
||||
for range count {
|
||||
attrs = append(attrs, pool[rand.Intn(len(pool))])
|
||||
}
|
||||
obj.SetAttributes(attrs...)
|
||||
|
|
|
@ -29,7 +29,7 @@ func PopulateWithObjects(
|
|||
) {
|
||||
digits := "0123456789"
|
||||
|
||||
for i := uint(0); i < count; i++ {
|
||||
for range count {
|
||||
obj := factory()
|
||||
|
||||
id := []byte(fmt.Sprintf(
|
||||
|
@ -59,7 +59,7 @@ func PopulateWithBigObjects(
|
|||
count uint,
|
||||
factory func() *objectSDK.Object,
|
||||
) {
|
||||
for i := uint(0); i < count; i++ {
|
||||
for range count {
|
||||
group.Go(func() error {
|
||||
if err := populateWithBigObject(ctx, db, factory); err != nil {
|
||||
return fmt.Errorf("couldn't put a big object: %w", err)
|
||||
|
@ -154,7 +154,7 @@ func PopulateGraveyard(
|
|||
wg := &sync.WaitGroup{}
|
||||
wg.Add(int(count))
|
||||
|
||||
for i := uint(0); i < count; i++ {
|
||||
for range count {
|
||||
obj := factory()
|
||||
|
||||
prm := meta.PutPrm{}
|
||||
|
@ -226,7 +226,7 @@ func PopulateLocked(
|
|||
wg := &sync.WaitGroup{}
|
||||
wg.Add(int(count))
|
||||
|
||||
for i := uint(0); i < count; i++ {
|
||||
for range count {
|
||||
defer wg.Done()
|
||||
|
||||
obj := factory()
|
||||
|
|
|
@ -116,7 +116,7 @@ func populate() (err error) {
|
|||
eg, ctx := errgroup.WithContext(ctx)
|
||||
eg.SetLimit(int(jobs))
|
||||
|
||||
for i := uint(0); i < numContainers; i++ {
|
||||
for range numContainers {
|
||||
cid := cidtest.ID()
|
||||
|
||||
for _, typ := range types {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue