Skip to content

Commit f7e8d46

Browse files
author
くしゃみの人
authored
Merge pull request #26 from voyagegroup/feature_support_amazon-s3_object-lock
Fix data handling and timing for gzip and md5
2 parents d7cc9e5 + c777a88 commit f7e8d46

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.swp
22
.env
3+
.go-version
34
sltd
45
pkg/*
56
dist/*

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: go
22

33
go:
4-
- 1.8
4+
- 1.11
55
- master
66

77
before_install:
@@ -15,4 +15,4 @@ deploy:
1515
script: make dist
1616
on:
1717
branch: master
18-
go: 1.8
18+
go: 1.11

transferd.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ func (td *transferd) flush() error {
8383
hash := md5.New()
8484
go func() {
8585
gw := gzip.NewWriter(writer)
86-
md5sum = base64.StdEncoding.EncodeToString(hash.Sum([]byte(strings.Join(chunk, "\n"))))
87-
gw.Write([]byte(strings.Join(chunk, "\n")))
86+
buffer := []byte(strings.Join(chunk, "\n"))
87+
gw.Write(buffer)
88+
md5sum = base64.StdEncoding.EncodeToString(hash.Sum(buffer))
8889
gw.Close()
8990
writer.Close()
9091
}()

0 commit comments

Comments
 (0)