Skip to content

Commit

Permalink
refactor: replace setModTime by Modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien HOUZÉ committed Jul 21, 2021
1 parent f544da3 commit 1218f58
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
Expand Up @@ -62,8 +62,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

if a.outputFileMode != "" {
filemode, err := strconv.ParseUint(a.outputFileMode, 0, 32)
Expand Down Expand Up @@ -146,8 +145,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

if a.outputFileMode != "" {
filemode, err := strconv.ParseUint(a.outputFileMode, 0, 32)
Expand Down

0 comments on commit 1218f58

Please sign in to comment.