From 5273cfd3150418ed34dd1d3344090840477b3fa3 Mon Sep 17 00:00:00 2001 From: qydysky Date: Sat, 1 Aug 2020 04:14:07 +0800 Subject: [PATCH] 18 --- Zip.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Zip.go b/Zip.go index 4e4ac41..ece5659 100644 --- a/Zip.go +++ b/Zip.go @@ -163,11 +163,10 @@ func (t *rZip) New(zipFile string) (error) { return nil } -func (t *rZip) Read(path string) (*bytes.Buffer,string,error) { +func (t *rZip) Read(path string) (*bytes.Buffer,time.Time,error) { t.Lock() defer t.Unlock() - var timeLayoutStr = "2006-01-02 15:04:05" var err error if f,ok := t.buf[path];ok { @@ -176,11 +175,11 @@ func (t *rZip) Read(path string) (*bytes.Buffer,string,error) { buf := new(bytes.Buffer) buf.ReadFrom(rc) - return buf,f.FileHeader.Modified.Format(timeLayoutStr),nil + return buf,f.FileHeader.Modified,nil } - return &bytes.Buffer{},time.Now().UTC().Format(timeLayoutStr),err + return &bytes.Buffer{},time.Now().UTC(),err } - return &bytes.Buffer{},time.Now().UTC().Format(timeLayoutStr),errors.New("not found") + return &bytes.Buffer{},time.Now().UTC(),errors.New("not found") } func (t *rZip) List() []string { -- 2.39.2