-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
refactor(store): add miss defer #20602
Conversation
WalkthroughWalkthroughThe recent changes focus on ensuring proper resource management in the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Outside diff range and nitpick comments (9)
store/v2/migration/manager.go (2)
Line range hint
98-98
: Undefined functionNewMigrationStream
used.Please ensure that the function
NewMigrationStream
is defined or imported correctly. If it's supposed to be part of another package, you might need to import that package or define the function.
Line range hint
118-118
: Unused variablestoreKey
.The variable
storeKey
is declared but not used within the function. Consider removing it or using it as intended to avoid cluttering the codebase with unused variables.store/v2/commitment/store.go (7)
Line range hint
42-42
: Undefined typeTree
.The type
Tree
is used but not defined or imported in this file. Ensure that you have the correct imports or definitions in place forTree
.
Line range hint
29-29
: Undefined packagestore
.The package
store
is referenced but not imported. Ensure that the correct package is imported to resolve thestore.Committer
and other interfaces.Also applies to: 31-31
Line range hint
46-46
: Undefined typeTree
in constructor.The constructor
NewCommitStore
uses the typeTree
which is not defined or imported. Please define or import it to ensure the constructor works as intended.
Line range hint
379-379
: Undefined errorErrorExportDone
.The error
ErrorExportDone
is used but not defined or imported. Ensure that this error is correctly defined or imported from the appropriate package.
Line range hint
411-411
: Undefined typeImporter
.The type
Importer
is used but not defined or imported in this file. Ensure that you have the correct imports or definitions in place forImporter
.
Line range hint
413-413
: Unused variablestoreKey
.The variable
storeKey
is declared but not used within the function. Consider removing it or using it as intended to avoid cluttering the codebase with unused variables.
Line range hint
8-8
: Unused importmath
.The
math
package is imported but not used in this file. Consider removing the import to clean up the code.
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- store/v2/commitment/store.go (3 hunks)
- store/v2/migration/manager.go (1 hunks)
Additional context used
Path-based instructions (2)
store/v2/migration/manager.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.store/v2/commitment/store.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
golangci-lint
store/v2/migration/manager.go
98-98: undefined: NewMigrationStream (typecheck)
118-118: storeKey declared and not used (typecheck)
store/v2/commitment/store.go
42-42: undefined: Tree (typecheck)
29-29: undefined: store (typecheck)
31-31: undefined: store (typecheck)
46-46: undefined: Tree (typecheck)
379-379: undefined: ErrorExportDone (typecheck)
411-411: undefined: Importer (typecheck)
413-413: storeKey declared and not used (typecheck)
8-8: "math" imported and not used (typecheck)
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.
Nice work! 🏅
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- store/v2/commitment/store.go (3 hunks)
Additional context used
Path-based instructions (1)
store/v2/commitment/store.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (3)
store/v2/commitment/store.go (3)
137-137
: Ensure proper resource management by addingdefer batch.Close()
.This addition follows best practices for handling resources in Go, ensuring that the batch is closed properly, preventing potential resource leaks.
190-190
: Proper use ofdefer
to ensure resources are cleaned up.Adding
defer batch.Close()
influshCommitInfo
method is a good practice to prevent resource leaks.
311-311
: Correct application ofdefer
for resource management.The addition of
defer batch.Close()
in thePrune
method ensures that resources are properly managed and potential leaks are prevented.
* main: refactor(x/auth): Fix system test (#20531) feat(crypto): add blst (#20296) docs: Update high level overview and introduction (#20535) refactor(x/core): remove test (#20624) feat(x/mint)!: Replace InflationCalculationFn with MintFn + simple epoch minting (#20363) docs: remove duplicate words (#20622) feat: prep for errors v2 (#20539) chore: reduce default inflation (#20606) refactor(store): add miss defer (#20602) chore: use comet api pkg instead of comet alias (#20614) chore: write gentx info to cmd.ErrOrStderr (#20616) docs: ADR 073: update to accepted and add to README.md (#20619) chore(proto): change future extracted modules version from v1.0.0 to v0.2.0 (#20600) fix: remove some duplicate words (#20605) feat(stf): port simappv2 changes (#20587) chore: bring patch changelogs to main (#20599)
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit