github-vet / github-vet/rangeloop-pointer-findings
9gel/gknot: src/9gel/gknot/model.go; 17 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [9gel/gknot](https://www.github.com/9gel/gknot) at [src/9gel/gknot/model.go](https://github.com/9gel/gknot/blob/9c128ba252db7e1bbaf6f744e7bd94d30b8a290e/src/9gel/gknot/model.go#L267-L283)
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 cell was used in a composite literal at line 270
[Click here to see the code in its original context.](https://github.com/9gel/gknot/blob/9c128ba252db7e1bbaf6f744e7bd94d30b8a290e/src/9gel/gknot/model.go#L267-L283)
Click here to show the 17 line(s) of Go which triggered the analyzer.
```go
for _, cell := range piece.Cells {
if existPiece, ok := puzzle.CellMap[cell]; ok {
// Panic because the default puzzle should not have overlapping cells.
panic(&OverlapError{[]*Piece{piece, existPiece}, &cell})
}
if _, ok := nameSet[piece.Definition.Name]; ok {
// Panic because the default puzzle should not have pieces with the
// same names.
panic(&SameNameError{piece.Definition.Name})
}
if _, ok := escColorSet[piece.Definition.EscColor]; ok {
// Panic because the default puzzle should not have pieces with the
// same esc color.
panic(&SameEscColorError{piece.Definition.EscColor})
}
puzzle.CellMap[cell] = piece
}
```
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: 9c128ba252db7e1bbaf6f744e7bd94d30b8a290e
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.