This repository was archived by the owner on Nov 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +18
-8
lines changed Expand file tree Collapse file tree 4 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 1
1
module github.com/mholt/archiver/v3
2
2
3
- go 1.12
3
+ go 1.13
4
4
5
5
require (
6
6
github.com/andybalholm/brotli v1.0.0
@@ -12,7 +12,7 @@ require (
12
12
github.com/klauspost/pgzip v1.2.4
13
13
github.com/kr/text v0.2.0 // indirect
14
14
github.com/nwaples/rardecode v1.1.0
15
- github.com/pierrec/lz4/v3 v3.3.2
15
+ github.com/pierrec/lz4/v4 v4.0.3
16
16
github.com/ulikunitz/xz v0.5.7
17
17
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
18
18
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
45
45
github.com/onsi/ginkgo v1.8.0 /go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE =
46
46
github.com/onsi/gomega v1.5.0 /go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY =
47
47
github.com/pierrec/cmdflag v0.0.2 /go.mod h1:a3zKGZ3cdQUfxjd0RGMLZr8xI3nvpJOB+m6o/1X5BmU =
48
- github.com/pierrec/lz4/v3 v3.3.2 h1:QTUOCbMNDbK4PYtkuHyOBd28C0UhPBw3T4OH4WpFDik =
49
- github.com/pierrec/lz4/v3 v3.3.2 /go.mod h1:280XNCGS8jAcG++AHdd6SeWnzyJ1w9oow2vbORyey8Q =
48
+ github.com/pierrec/lz4/v4 v4.0.3 h1:vNQKSVZNYUEAvRY9FaUXAF1XPbSOHJtDTiP41kzDz2E =
49
+ github.com/pierrec/lz4/v4 v4.0.3 /go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4 =
50
50
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
51
51
github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
52
52
github.com/schollz/progressbar/v2 v2.13.2 /go.mod h1:6YZjqdthH6SCZKv2rqGryrxPtfmRB/DWZxSMfCXPyD8 =
Original file line number Diff line number Diff line change 5
5
"io"
6
6
"path/filepath"
7
7
8
- "github.com/pierrec/lz4/v3 "
8
+ "github.com/pierrec/lz4/v4 "
9
9
)
10
10
11
11
// Lz4 facilitates LZ4 compression.
@@ -16,7 +16,12 @@ type Lz4 struct {
16
16
// Compress reads in, compresses it, and writes it to out.
17
17
func (lz * Lz4 ) Compress (in io.Reader , out io.Writer ) error {
18
18
w := lz4 .NewWriter (out )
19
- w .Header .CompressionLevel = lz .CompressionLevel
19
+ options := []lz4.Option {
20
+ lz4 .CompressionLevelOption (lz4 .CompressionLevel (1 << (8 + lz .CompressionLevel ))),
21
+ }
22
+ if err := w .Apply (options ... ); err != nil {
23
+ return err
24
+ }
20
25
defer w .Close ()
21
26
_ , err := io .Copy (w , in )
22
27
return err
Original file line number Diff line number Diff line change 5
5
"io"
6
6
"strings"
7
7
8
- "github.com/pierrec/lz4/v3 "
8
+ "github.com/pierrec/lz4/v4 "
9
9
)
10
10
11
11
// TarLz4 facilitates lz4 compression
@@ -84,7 +84,12 @@ func (tlz4 *TarLz4) wrapWriter() {
84
84
var lz4w * lz4.Writer
85
85
tlz4 .Tar .writerWrapFn = func (w io.Writer ) (io.Writer , error ) {
86
86
lz4w = lz4 .NewWriter (w )
87
- lz4w .Header .CompressionLevel = tlz4 .CompressionLevel
87
+ options := []lz4.Option {
88
+ lz4 .CompressionLevelOption (lz4 .CompressionLevel (1 << (8 + tlz4 .CompressionLevel ))),
89
+ }
90
+ if err := lz4w .Apply (options ... ); err != nil {
91
+ return lz4w , err
92
+ }
88
93
return lz4w , nil
89
94
}
90
95
tlz4 .Tar .cleanupWrapFn = func () {
You can’t perform that action at this time.
0 commit comments