Skip to content

Commit e3ac0fd

Browse files
committed
chore: enable rangeValCopy from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 022a5ea commit e3ac0fd

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ linters:
7474
- hugeParam
7575
- importShadow
7676
- paramTypeCombine # WON'T FIX
77-
- rangeValCopy
7877
- returnAfterHttpError
7978
- todoCommentWithoutDetail
8079
- unnamedResult

cmd/anonymizer/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ func main() {
6666
logger.Error("Failed to close grpc client connection", zap.Error(err))
6767
}
6868

69-
for _, span := range spans {
70-
if err := w.WriteSpan(&span); err != nil {
69+
for i := range spans {
70+
span := &spans[i]
71+
if err := w.WriteSpan(span); err != nil {
7172
if errors.Is(err, writer.ErrMaxSpansCountReached) {
7273
logger.Info("max spans count reached")
7374
os.Exit(0)

internal/storage/v1/grpc/shared/grpc_client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,14 @@ func (c *GRPCClient) FindTraces(ctx context.Context, query *spanstore.TraceQuery
152152
return nil, fmt.Errorf("stream error: %w", err)
153153
}
154154

155-
for i, span := range received.Spans {
155+
for i := range received.Spans {
156+
span := &received.Spans[i]
156157
if trace == nil || span.TraceID != traceID {
157158
trace = &model.Trace{}
158159
traceID = span.TraceID
159160
traces = append(traces, trace)
160161
}
161-
trace.Spans = append(trace.Spans, &received.Spans[i])
162+
trace.Spans = append(trace.Spans, span)
162163
}
163164
}
164165
return traces, nil

internal/storage/v2/clickhouse/tracestore/dbmodel/to_dbmodel.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ func (link *LinkColumnSet) linkInput() proto.Input {
441441
func (acm attributeColumnsMap) attributesInput() proto.Input {
442442
var result []proto.InputColumn
443443
for _, pair := range acm {
444-
result = append(result,
444+
result = append(result,
445445
input(pair.keyColName, pair.keyCol),
446446
input(pair.valueColName, pair.valueCol),
447447
)
@@ -476,7 +476,8 @@ func (acm attributeColumnsMap) appendNestedAttributeGroup(nestedGroup NestedAttr
476476
var strValues [][]string
477477
var bytesKeys [][]string
478478
var bytesValues [][]string
479-
for _, group := range nestedGroup.AttributesGroups {
479+
for i := range nestedGroup.AttributesGroups {
480+
group := &nestedGroup.AttributesGroups[i]
480481
boolKeys = append(boolKeys, group.BoolKeys)
481482
boolValues = append(boolValues, group.BoolValues)
482483
doubleKeys = append(doubleKeys, group.DoubleKeys)

0 commit comments

Comments
 (0)