Skip to content

Commit 1218f58

Browse files
author
Sébastien HOUZÉ
committed
refactor: replace setModTime by Modified
1 parent f544da3 commit 1218f58

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/provider/zip_archiver.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ func (a *ZipArchiver) ArchiveFile(infilename string) error {
6262
fh.Name = filepath.ToSlash(fi.Name())
6363
fh.Method = zip.Deflate
6464
oldestZipSupportedModTime, _ := time.Parse(time.RFC3339, "1980-01-01T00:00:00+00:00")
65-
// fh.Modified alone isn't enough when using a zero value
66-
fh.SetModTime(oldestZipSupportedModTime)
65+
fh.Modified = oldestZipSupportedModTime
6766

6867
if a.outputFileMode != "" {
6968
filemode, err := strconv.ParseUint(a.outputFileMode, 0, 32)
@@ -146,8 +145,7 @@ func (a *ZipArchiver) ArchiveDir(indirname string, excludes []string) error {
146145
fh.Name = filepath.ToSlash(relname)
147146
fh.Method = zip.Deflate
148147
oldestZipSupportedModTime, _ := time.Parse(time.RFC3339, "1980-01-01T00:00:00+00:00")
149-
// fh.Modified alone isn't enough when using a zero value
150-
fh.SetModTime(oldestZipSupportedModTime)
148+
fh.Modified = oldestZipSupportedModTime
151149

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

0 commit comments

Comments
 (0)