chore(deps): remove dependency on github.com/pkg/errors#2184
chore(deps): remove dependency on github.com/pkg/errors#2184mangalaman93 merged 3 commits intodgraph-io:mainfrom hazzik:chore/err
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes the dependency on github.com/pkg/errors and updates error creation and wrapping accordingly throughout the codebase. Key changes include replacing errors.Errorf and errors.Wrapf with fmt.Errorf and errors.New, and removing the import of github.com/pkg/errors.
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| value.go | Replaced pkg/errors usage with built-in errors and fmt.Errorf |
| util.go | Removed pkg/errors import; minor update to error handling |
| txn.go | Updated error formatting and removed pkg/errors import |
| trie/trie.go | Updated error wrapping for ignore bytes parsing |
| table/table.go | Switched to using errors and fmt.Errorf instead of pkg/errors |
| table/builder.go | Removed pkg/errors import and updated corresponding error handling |
| stream_writer.go | Updated error wrapping in flatten and key order checks |
| publisher_test.go | Removed pkg/errors import in tests |
| options.go | Replaced pkg/errors usage with fmt.Errorf in compression parsing |
| memtable.go | Updated error message in file existence check |
| manifest.go | Removed pkg/errors import; updated error creation for magic/checksum errors |
| levels.go | Replaced pkg/errors usage with errors.New in table-filling error |
| db.go | Updated error messages and error wrapping across various checks |
| batch.go | Replaced pkg/errors usage with fmt.Errorf in batch flushing errors |
| badger/cmd/stream.go | Removed pkg/errors import; updated error creation for CLI validations |
| badger/cmd/read_bench.go | Removed pkg/errors import; updated error creation in test logic |
| badger/cmd/info.go | Removed pkg/errors import; updated error message formatting |
| badger/cmd/flatten.go | Removed pkg/errors import; updated error creation for compression checks |
| backup.go | Switched pkg/errors usage to fmt.Errorf for error wrapping in backup logic |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
db.go:154
- [nitpick] Consider using consistent capitalization for 'ValueThreshold' rather than 'Valuethreshold' in the error message.
return fmt.Errorf("Valuethreshold %d greater than max batch size of %d. Either "+
|
Thank you for the PR, why does it not remove this package from go.mod? |
|
Some other dependencies still have it referenced: Would need to update ristretto when next version is released: dgraph-io/ristretto@a748a7f as you have renovate set up it would be done some time automatically. |
|
We should upgrade ristretto to v2.2.0 released here https://github.com/hypermodeinc/ristretto/releases/tag/v2.2.0 |
|
@mangalaman93 do you want me to do it in this PR? or I can create another one with upgrade, or wait for renovate. I'm not in a rush. |
|
This PR is fine too |
|
@mangalaman93 done |
Description
Remove dependency on github.com/pkg/errors as it was archived
Checklist
CHANGELOG.mdfile describing and linking tothis PR
staged and linked here
Instructions
syntax, leading with
fix:,feat:,chore:,ci:, etc.link to the bug.
[x]syntax.back and check the box later.
Instructionsline and everything below it, to indicate you have read and arefollowing these instructions. 🙂
Thank you for your contribution to Badger!