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

3ofcoins/jetpack: lib/jetpack/host.go; 9 LoC

Open
#6,160 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 [3ofcoins/jetpack](https://www.github.com/3ofcoins/jetpack) at [lib/jetpack/host.go](https://github.com/3ofcoins/jetpack/blob/502c8ae5af14d4c086b56171e893e17c60436710/lib/jetpack/host.go#L224-L232)

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 mntc is reassigned at line 229

[Click here to see the code in its original context.](https://github.com/3ofcoins/jetpack/blob/502c8ae5af14d4c086b56171e893e17c60436710/lib/jetpack/host.go#L224-L232)

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

```go
for _, mntc := range rtapp.Mounts {
if mntc.Path == mntpnt.Path || mntc.Path == mntpnt.Name.String() {
if mnt != nil {
fmt.Printf("WARNING: multiple mounts for %v:%v, using first one")
} else {
mnt = &mntc
}
}
}

```

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: 502c8ae5af14d4c086b56171e893e17c60436710

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.