github-vet / rangeloop-pointer-findings

Issue tracker collects instances of Go code on GitHub that make use of references to range loop variables.
0 stars 0 forks source link

nogiushi/marvin: persist/persist.go; 13 LoC #18414

Open githubvet opened 3 years ago

githubvet commented 3 years ago

Found a possible issue in nogiushi/marvin at persist/persist.go

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.

Click here to show the 13 line(s) of Go which triggered the analyzer. ```go for m := range in { if p.db == nil { if db := p.initDB(); db != nil { p.db = db } else { log.Println("WARNING: could not create database to persist messages.") out <- nog.Message{What: "could not create database to persist messages"} break } } m.Hash = m.When[0:10] p.db.PutItem(messageTableName, p.db.ToItem(&m), nil) } ```
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 {ToItem 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 for more information.

commit ID: b9fe532e391984c3ec750be8712ae93ea6a9c658