mirror of
https://github.com/goreleaser/nfpm
synced 2024-11-19 03:25:08 +01:00
style: deb: simplified code a little
This commit is contained in:
parent
6760f1586a
commit
e4f8dde4bc
@ -5,7 +5,6 @@ import (
|
||||
"archive/tar"
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"encoding/hex"
|
||||
// #nosec
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user