github-vet / github-vet/rangeloop-pointer-findings
pierrec/go-cuckoofilter: generate/main.go; 17 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [pierrec/go-cuckoofilter](https://www.github.com/pierrec/go-cuckoofilter) at [generate/main.go](https://github.com/pierrec/go-cuckoofilter/blob/25a093bdc2756e859d08633638f747efd23015dc/generate/main.go#L64-L80)
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/pierrec/go-cuckoofilter/blob/25a093bdc2756e859d08633638f747efd23015dc/generate/main.go#L64-L80)
Click here to show the 17 line(s) of Go which triggered the analyzer.
```go
for _, data := range []cData{
{Name: "S", NumBits: 8, NumBitsFingerprint: 4, Desc: "1 byte per item", ErrRate: 11, MaxInserts: 2},
{Name: "M", NumBits: 16, NumBitsFingerprint: 8, Desc: "2 bytes per item", ErrRate: 1, MaxInserts: 2},
{Name: "L", NumBits: 32, NumBitsFingerprint: 16, Desc: "4 bytes per item", ErrRate: 0.005, MaxInserts: 2},
// similar error rate as bucket 32 / fingerprint 16 with twice the memory footprint
// {Name: "L", NumBits: 64, NumBitsFingerprint: 16, Desc: "8 bytes per item", ErrRate: 0.005, MaxInserts: 4},
} {
log.Printf("Generating %s\n", data.Name)
// Compute the uint size to hold a fingerprint
data.NumBitsFingerprintUint = power2(data.NumBitsFingerprint)
if data.NumBitsFingerprintUint < 8 {
data.NumBitsFingerprintUint = 8
}
genFile(fmt.Sprintf("cuckoo%s.go", data.Name), tmpl, &data)
genFile(fmt.Sprintf("cuckoo%s_test.go", data.Name), tmplTest, &data)
genFile(fmt.Sprintf("bench%s_test.go", data.Name), tmplBench, &data)
}
```
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 {genFile 3} 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: 25a093bdc2756e859d08633638f747efd23015dc
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.