Skip to content
Snippets Groups Projects
Commit 5abad3b2 authored by Francé Wilke's avatar Francé Wilke
Browse files

Merge branch 'main' of gitlab.com:uafrica/go-utils

parents e327801b df7b3695
Branches
Tags
No related merge requests found
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"os" "os"
"strconv" "strconv"
"strings" "strings"
"time"
"gitlab.com/uafrica/go-utils/struct_utils" "gitlab.com/uafrica/go-utils/struct_utils"
) )
...@@ -50,8 +51,14 @@ func ZipData(fileName string, data []byte) ([]byte, error) { ...@@ -50,8 +51,14 @@ func ZipData(fileName string, data []byte) ([]byte, error) {
// Create a new zip archive. // Create a new zip archive.
zipWriter := zip.NewWriter(buf) zipWriter := zip.NewWriter(buf)
header := &zip.FileHeader{
Name: fileName,
Method: zip.Deflate,
Modified: time.Now(),
}
// Write data // Write data
file, err := zipWriter.Create(fileName) file, err := zipWriter.CreateHeader(header)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment