Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace setModTime by Modified
Browse files Browse the repository at this point in the history
Sébastien HOUZÉ committed Jul 21, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent f60de5b commit 1e7fa73
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/provider/zip_archiver.go
Original file line number Diff line number Diff line change
@@ -60,8 +60,7 @@ func (a *ZipArchiver) ArchiveFile(infilename string) error {
fh.Name = filepath.ToSlash(fi.Name())
fh.Method = zip.Deflate
oldestZipSupportedModTime, _ := time.Parse(time.RFC3339, "1980-01-01T00:00:00+00:00")
// fh.Modified alone isn't enough when using a zero value
fh.SetModTime(oldestZipSupportedModTime)
fh.Modified = oldestZipSupportedModTime

f, err := a.writer.CreateHeader(fh)
if err != nil {
@@ -136,8 +135,7 @@ func (a *ZipArchiver) ArchiveDir(indirname string, excludes []string) error {
fh.Name = filepath.ToSlash(relname)
fh.Method = zip.Deflate
oldestZipSupportedModTime, _ := time.Parse(time.RFC3339, "1980-01-01T00:00:00+00:00")
// fh.Modified alone isn't enough when using a zero value
fh.SetModTime(oldestZipSupportedModTime)
fh.Modified = oldestZipSupportedModTime

f, err := a.writer.CreateHeader(fh)
if err != nil {

0 comments on commit 1e7fa73

Please sign in to comment.