Skip to content

Idiomatic Go return order#265

Merged
UdeshyaDhungana merged 1 commit intoaof-write-1from
cursor/idiomatic-go-return-order-140b
Apr 6, 2026
Merged

Idiomatic Go return order#265
UdeshyaDhungana merged 1 commit intoaof-write-1from
cursor/idiomatic-go-return-order-140b

Conversation

@UdeshyaDhungana
Copy link
Copy Markdown
Contributor

@UdeshyaDhungana UdeshyaDhungana commented Apr 6, 2026

Refactor assertEmptyAofFileCase to use idiomatic Go error return order to prevent maintenance hazards.


Note

Low Risk
Low risk: this is a small refactor that only changes the return-value ordering for assertEmptyAofFileCase and its caller, without altering assertion behavior.

Overview
Adjusts AofAppendOnlyFileAssertion.assertEmptyAofFileCase to return (bool, error) (done-first, error-last) and updates the Run() call site accordingly, aligning with idiomatic Go and reducing the chance of misusing the results during future edits.

Reviewed by Cursor Bugbot for commit b8b7fb6. Bugbot is set up for automated code reviews on this repo. Configure here.

Change the return signature from (error, bool) to (bool, error) to follow
Go's convention of placing the error as the last return value. Update the
call site accordingly.
@UdeshyaDhungana UdeshyaDhungana merged commit 8ff2733 into aof-write-1 Apr 6, 2026
3 checks passed
@cursor cursor bot deleted the cursor/idiomatic-go-return-order-140b branch April 6, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants