From 3d1694bbd173480fa6fe9689cc49a08bf43df3a6 Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Mon, 12 Aug 2019 00:02:17 +0300 Subject: [PATCH] [misc] Minor changes --- scripts/z-run | 13 +++++++------ sources/cmd/archiver.go | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/z-run b/scripts/z-run index 13cba74..d4d7dd2 100644 --- a/scripts/z-run +++ b/scripts/z-run @@ -47,28 +47,28 @@ exec -- "${ZRUN[@]}" ':: go / tool' \ build \ -v \ - -ldflags '-s' \ + -ldflags 'all=-s' \ + -gcflags 'all=-l=4' \ -o "${_outputs}/binaries/release/kawipiko-server" \ -- ./cmd/server.go \ # !! -<< go / build / server / release / analyze +<< go / build / server / analyze test "${#}" -eq 0 _outputs="$( exec -- readlink -e -- ./.outputs )" rm -f -- "${_outputs}/binaries/debug/kawipiko-server" exec -- "${ZRUN[@]}" ':: go / tool' \ build \ -v \ - -ldflags '-s' \ -gcflags '-m' \ -o "${_outputs}/binaries/debug/kawipiko-server" \ -- ./cmd/server.go \ # !! -<< go / build / server / release / analyze / escapes - "${ZRUN[@]}" ':: go / build / server / release / analyze' "${@}" \ +<< go / build / server / analyze / escapes + "${ZRUN[@]}" ':: go / build / server / analyze' "${@}" \ 2>&1 \ | grep -F -e ' escapes ' \ | LC_ALL=C sort -n -k 2,2 -t ':' @@ -123,7 +123,8 @@ exec -- "${ZRUN[@]}" ':: go / tool' \ build \ -v \ - -ldflags '-s' \ + -ldflags 'all=-s' \ + -gcflags 'all=-l=4' \ -o "${_outputs}/binaries/release/kawipiko-archiver" \ -- ./cmd/archiver.go \ # diff --git a/sources/cmd/archiver.go b/sources/cmd/archiver.go index b6061a1..7759dcb 100644 --- a/sources/cmd/archiver.go +++ b/sources/cmd/archiver.go @@ -142,14 +142,14 @@ func archiveFile (_context *context, _pathResolved string, _pathInArchive string func archiveFolder (_context *context, _pathResolved string, _pathInArchive string, _names []string, _stats map[string]os.FileInfo) (error) { type Entry struct { - Name string `json:"name",omitempty` - Type string `json:"type",omitempty` - Size uint64 `json:"size",omitempty"` + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Size uint64 `json:"size,omitempty"` } type Folder struct { - Entries []Entry `json:"entries",omitempty` - Indices []string `json:"indices",omitempty` + Entries []Entry `json:"entries,omitempty"` + Indices []string `json:"indices,omitempty"` } _entries := make ([]Entry, 0, len (_names))