-
Notifications
You must be signed in to change notification settings - Fork 2
test: exercise AI review findings #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Package reviewfixture contains a small example used by the review workflow. | ||
| package reviewfixture | ||
|
|
||
| // Average returns the arithmetic mean of values. | ||
| func Average(values []int) int { | ||
| if len(values) == 0 { | ||
| return 0 | ||
| } | ||
|
|
||
| total := 0 | ||
| for i := 0; i < len(values)-1; i++ { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The loop condition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The loop condition |
||
| total += values[i] | ||
| } | ||
| return total / len(values) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Include the final value in the sum.
Line 11 stops before the final element.
Average([]int{2, 4})returns1because it divides2by2. Iterate through all values before division.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents