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

glassechidna/pstore: pkg/pstore/common.go; 31 LoC

Open
#17,365 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 [glassechidna/pstore](https://www.github.com/glassechidna/pstore) at [pkg/pstore/common.go](https://github.com/glassechidna/pstore/blob/aafa4546d26e2f39e7b41ed12cf2eb0c4d22c757/pkg/pstore/common.go#L155-L185)

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

[Click here to see the code in its original context.](https://github.com/glassechidna/pstore/blob/aafa4546d26e2f39e7b41ed12cf2eb0c4d22c757/pkg/pstore/common.go#L155-L185)

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

```go
for _, path := range input {
input := &ssm.GetParametersByPathInput{
Path: &path,
Recursive: aws.Bool(true),
WithDecryption: aws.Bool(true),
}
api.GetParametersByPathPagesWithContext(
context.Background(),
input,
func(page *ssm.GetParametersByPathOutput, lastPage bool) bool {
for _, param := range page.Parameters {
parts := strings.Split(*param.Name, "/")
name := parts[len(parts)-1]
results = append(results, ParamResult{
ParamName: "",
EnvName: name,
Value: *param.Value,
RequestID: requestID,
Success: true,
Err: nil,
})
}
return !lastPage
},
func(r *request.Request) {
r.Handlers.Complete.PushBack(func(req *request.Request) {
requestID = req.RequestID
})

})
}

```

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: aafa4546d26e2f39e7b41ed12cf2eb0c4d22c757

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.