fix: replace golang/snappy with klauspost/compress/snappy #2248
+13
−71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replace
github.com/golang/snappywithgithub.com/klauspost/compress/snappythroughout the codebase. This change updates all import statements, dependency declarations, and license notices to use the klauspost implementation of Snappy compression.Background & Motivation
The original
golang/snappypackage has been archived and is no longer actively maintained. Theklauspost/compresslibrary provides a drop-in replacement with the same API that is:klauspost/compressfor zstd compressionThis change eliminates our dependency on an archived package and consolidates our compression dependencies under a single, well-maintained library.
Changes Made
Source Code
x/mongo/driver/compression.gox/mongo/driver/compression_test.gox/mongo/driver/testdata/compression.goDependencies
github.com/golang/snappy v1.0.0fromgo.modgo.modfiles viago mod tidyinternal/test/goleak/go.modto properly reference v2 module pathDocumentation
github.com/golang/snappylicense notice fromTHIRD-PARTY-NOTICESgithub.com/klauspost/compress/snappylicense noticeTesting
go build ./...succeeds across all packages