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

snapcore/snapd: cmd/snap/cmd_recovery.go; 10 LoC

Open
#16,956 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [snapcore/snapd](https://www.github.com/snapcore/snapd) at [cmd/snap/cmd_recovery.go](https://github.com/snapcore/snapd/blob/0e619da461982e6564a93098660087cc765d6327/cmd/snap/cmd_recovery.go#L104-L113)

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 sys was used in a composite literal at line 110

[Click here to see the code in its original context.](https://github.com/snapcore/snapd/blob/0e619da461982e6564a93098660087cc765d6327/cmd/snap/cmd_recovery.go#L104-L113)

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

```go
for _, sys := range systems {
// doing it this way because otherwise it's a sea of %s\t%s\t%s
line := []string{
sys.Label,
shortPublisher(esc, &sys.Brand),
sys.Model.Model,
notesForSystem(&sys),
}
fmt.Fprintln(w, strings.Join(line, "\t"))
}

```

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: 0e619da461982e6564a93098660087cc765d6327

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with cmd/snap/cmd_recovery.go at lines 104-113 and inspect the range loop over systems, including the references passed to shortPublisher and notesForSystem. Determine whether the analyzer's reported reference to sys represents a real bug, a mitigated issue, or desirable behavior, then classify it with the corresponding reaction described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.