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

l3uddz/crop: cmd/clean.go; 30 LoC

Open
#9,924 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 [l3uddz/crop](https://www.github.com/l3uddz/crop) at [cmd/clean.go](https://github.com/l3uddz/crop/blob/9c9802832ef5db0964570caf2c194790379583df/cmd/clean.go#L27-L56)

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

[Click here to see the code in its original context.](https://github.com/l3uddz/crop/blob/9c9802832ef5db0964570caf2c194790379583df/cmd/clean.go#L27-L56)

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

```go
for _, uploaderConfig := range config.Config.Uploader {
log := log.WithField("uploader", uploaderConfig.Name)

// skip disabled uploader(s)
if !uploaderConfig.Enabled {
log.Debug("Skipping disabled uploader")
continue
}

// skip uploader specific chosen
if flagUploader != "" && !strings.EqualFold(uploaderConfig.Name, flagUploader) {
log.Debugf("Skipping uploader as not: %q", flagUploader)
continue
}

// create uploader
upload, err := uploader.New(config.Config, &uploaderConfig, uploaderConfig.Name)
if err != nil {
log.WithError(err).Error("Failed initializing uploader, skipping...")
continue
}

log.Info("Clean commencing...")

// perform upload
if err := performClean(upload); err != nil {
upload.Log.WithError(err).Error("Error occurred while running clean, skipping...")
continue
}
}

```

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: 9c9802832ef5db0964570caf2c194790379583df

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.