github-vet / github-vet/rangeloop-pointer-findings
eriol/piken: main.go; 20 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [eriol/piken](https://www.github.com/eriol/piken) at [main.go](https://github.com/eriol/piken/blob/983604dfeab28b982cc11985d1f0a7808d812e97/main.go#L154-L173)
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 row was used in a composite literal at line 156
[Click here to see the code in its original context.](https://github.com/eriol/piken/blob/983604dfeab28b982cc11985d1f0a7808d812e97/main.go#L154-L173)
Click here to show the 20 line(s) of Go which triggered the analyzer.
```go
for _, row := range rows {
b, err := formatter.Format(&row)
if err != nil {
logrus.Fatal(err)
}
fmt.Println(b)
// Copy to clipboard only when one row is returned by search.
if c.Bool("copy") && len(rows) == 1 {
glyph, err := format.CodePointToGlyph(row.CodePoint)
if err != nil {
logrus.Fatalf("Impossible to convert %s to glyph.",
row.CodePoint)
}
if err := clipboard.WriteAll(glyph); err != nil {
logrus.Fatalf("Copy to clipboard failed: %v", err)
}
}
}
```
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: 983604dfeab28b982cc11985d1f0a7808d812e97
Contributor guide
No contributing guide indexed for this repository
Research direction
Read the Go snippet in main.go at lines 154-173 and the linked original context, starting with the analyzer message about the reference to row in a composite literal. Decide whether the finding is a Bug, Mitigated, or Desirable Behavior, then leave the corresponding reaction on the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100