github-vet / github-vet/rangeloop-pointer-findings

lloydmeta/tasques: example/ciphers/server/routing/server.go; 15 LoC

Open
#15,188 0 comments 0 reactions 0 assignees View on GitHub
fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [lloydmeta/tasques](https://www.github.com/lloydmeta/tasques) at [example/ciphers/server/routing/server.go](https://github.com/lloydmeta/tasques/blob/83a686feb4f3efc8b00af8b439a09eef40f32cc4/example/ciphers/server/routing/server.go#L120-L134)

Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first issue it finds, so please do not limit your consideration to the contents of the below message.

> reference to cipher was used in a composite literal at line 127

[Click here to see the code in its original context.](https://github.com/lloydmeta/tasques/blob/83a686feb4f3efc8b00af8b439a09eef40f32cc4/example/ciphers/server/routing/server.go#L120-L134)

Click here to show the 15 line(s) of Go which triggered the analyzer.

```go
for _, cipher := range common.AllCiphers {
log.Info().Str("cipher", cipher).Msg("Inserting Task")
args := common.MessageArgs{
MessageId: message.ID,
}
createTaskParams := tasks.NewCreateTaskParams()
createTaskParams.NewTask = &models.TaskNewTask{
Kind: &cipher,
Args: args.ToMap(),
Queue: &c.queuerConfig.Queue,
}
if _, err := c.tasquesClient.Tasks.CreateTask(createTaskParams); err != nil {
errs = append(errs, err)
}
}

```

Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.

commit ID: 83a686feb4f3efc8b00af8b439a09eef40f32cc4

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with example/ciphers/server/routing/server.go at lines 120-134 and inspect the range loop, especially the composite literal using cipher. Determine whether the reported reference is a bug, mitigated, or desirable behavior, then leave the corresponding reaction as the completed classification.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.