Skip to content
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

pebble: .DeleteSync has suspicious nil return for error condition as well as extraneous if err != nil + returns that masked the error #94

Closed
odeke-em opened this issue Oct 13, 2023 · 2 comments · Fixed by #95

Comments

@odeke-em
Copy link
Contributor

odeke-em commented Oct 13, 2023

If we examine this code, it does an unnecessary if err != nil check that then masks a suspicious nil error that was actually non-nil
image

If we just did return condition as a simple coding style, there wouldn't be any problems

/cc @elias-orijtech @tac0turtle @julienrbrt

@baabeetaa
Copy link

must be copy and paste https://github.com/cometbft/cometbft-db/blob/main/rocksdb.go#L140C13-L140C13

odeke-em added a commit to orijtech/cosmos-db that referenced this issue Oct 26, 2023
Removes pedantic returns that are non-idiomatic Go.

Fixes cosmos#94
@odeke-em
Copy link
Contributor Author

I've sent a fix in PR #95

tac0turtle pushed a commit that referenced this issue Oct 26, 2023
Removes pedantic returns that are non-idiomatic Go.

Fixes #94
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 a pull request may close this issue.

2 participants