github-vet / github-vet/rangeloop-pointer-findings
julienrbrt/ut_bitinc_project: database/tours.go; 32 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [julienrbrt/ut_bitinc_project](https://www.github.com/julienrbrt/ut_bitinc_project) at [database/tours.go](https://github.com/julienrbrt/ut_bitinc_project/blob/6173c550e4255de76cf7666f1849ac75913773fb/database/tours.go#L182-L213)
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.
>
[Click here to see the code in its original context.](https://github.com/julienrbrt/ut_bitinc_project/blob/6173c550e4255de76cf7666f1849ac75913773fb/database/tours.go#L182-L213)
Click here to show the 32 line(s) of Go which triggered the analyzer.
```go
for i, tour := range tours {
log.Printf("(%d / %d) %s\n", i+1, len(tours), loadingDataFromTransics)
//if never has been imported, only import from the tour startTime
if ignoreLastImport || (tour.LastImport == time.Time{}) {
tour.LastImport = tour.StartTime
}
//caculate elapsed time betfore last import and queries missing days
now := time.Now()
diff := int(now.Sub(tour.LastImport).Hours() / 24)
//for every days elapsed since last import
for day := diff; day >= 0; day-- {
//import eco monitor report
err = importEcoMoniorReport(&tour, day)
if err != nil {
log.Printf("ERROR: %s\n", err)
return err
}
//import activity report
err = importActivityReport(&tour, day)
if err != nil {
log.Printf("ERROR: %s\n", err)
return err
}
}
//update last import tour date
DB.Model(&tour).Where("id = ?", tour.ID).Update(Tour{LastImport: now})
}
```
Click here to show extra information the analyzer produced.
```
No path was found through the callgraph that could lead to a function which writes a pointer argument.
No path was found through the callgraph that could lead to a function which passes a pointer to third-party code.
root signature {Model 1} was not found in the callgraph; reference was passed directly to third-party code
```
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: 6173c550e4255de76cf7666f1849ac75913773fb
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.