github-vet / github-vet/rangeloop-pointer-findings
handlename/ssmwrap: ssm.go; 30 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [handlename/ssmwrap](https://www.github.com/handlename/ssmwrap) at [ssm.go](https://github.com/handlename/ssmwrap/blob/91f3edca4b9d94c75fa84d40ba8db3a612841d3e/ssm.go#L19-L48)
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 24
[Click here to see the code in its original context.](https://github.com/handlename/ssmwrap/blob/91f3edca4b9d94c75fa84d40ba8db3a612841d3e/ssm.go#L19-L48)
Click here to show the 30 line(s) of Go which triggered the analyzer.
```go
for _, path := range paths {
nextToken := ""
for {
input := &ssm.GetParametersByPathInput{
Path: &path,
Recursive: aws.Bool(recursive),
WithDecryption: aws.Bool(true),
}
if nextToken != "" {
input.SetNextToken(nextToken)
}
output, err := client.GetParametersByPath(input)
if err != nil {
return params, fmt.Errorf("failed to GetParametersByPath: %w", err)
}
for _, param := range output.Parameters {
params[*param.Name] = *param.Value
}
if output.NextToken == nil {
break
}
nextToken = *output.NextToken
}
}
```
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: 91f3edca4b9d94c75fa84d40ba8db3a612841d3e
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.