Skip to content

Commit

Permalink
style: deb: simplified code a little
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Feb 25, 2018
1 parent 6760f15 commit e4f8dde
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions deb/deb.go
Expand Up @@ -5,7 +5,6 @@ import (
"archive/tar"
"bytes"
"compress/gzip"
"encoding/hex"
// #nosec
"crypto/md5"
"fmt"
Expand Down Expand Up @@ -133,8 +132,7 @@ func copyToTarAndDigest(tarw *tar.Writer, md5w io.Writer, now time.Time, src, ds
if _, err := io.Copy(tarw, io.TeeReader(file, digest)); err != nil {
return 0, errors.Wrap(err, "failed to copy")
}
var hash = hex.EncodeToString(digest.Sum(nil))
if _, err := fmt.Fprintf(md5w, "%s %s\n", hash, header.Name[1:]); err != nil {
if _, err := fmt.Fprintf(md5w, "%x %s\n", digest.Sum(nil), header.Name[1:]); err != nil {
return 0, errors.Wrap(err, "failed to write md5")
}
return info.Size(), nil
Expand Down

0 comments on commit e4f8dde

Please sign in to comment.