From 5aefc741f215f48beb6f2523bdb3b2f9ad5394ee Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Sat, 13 Apr 2019 19:22:18 +0800 Subject: [PATCH] Add codec tag to fields which are ignored in new codec package github.com/ugorji/go/codec 1.1.4 ignores field with json:"-" tag --- deb/local.go | 4 ++-- deb/snapshot.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deb/local.go b/deb/local.go index 229f6e1d..5b8eb2a0 100644 --- a/deb/local.go +++ b/deb/local.go @@ -15,7 +15,7 @@ import ( // LocalRepo is a collection of packages created locally type LocalRepo struct { // Permanent internal ID - UUID string `json:"-"` + UUID string `codec:"UUID" json:"-"` // User-assigned name Name string // Comment @@ -25,7 +25,7 @@ type LocalRepo struct { // DefaultComponent DefaultComponent string `codec:",omitempty"` // Uploaders configuration - Uploaders *Uploaders `code:",omitempty" json:"-"` + Uploaders *Uploaders `codec:"Uploaders,omitempty" json:"-"` // "Snapshot" of current list of packages packageRefs *PackageRefList } diff --git a/deb/snapshot.go b/deb/snapshot.go index 307433af..aef19ae4 100644 --- a/deb/snapshot.go +++ b/deb/snapshot.go @@ -19,15 +19,15 @@ import ( // Snapshot is immutable state of repository: list of packages type Snapshot struct { // Persisten internal ID - UUID string `json:"-"` + UUID string `codec:"UUID" json:"-"` // Human-readable name Name string // Date of creation CreatedAt time.Time // Source: kind + ID - SourceKind string `json:"-"` - SourceIDs []string `json:"-"` + SourceKind string `codec:"SourceKind" json:"-"` + SourceIDs []string `codec:"SourceIDs" json:"-"` // Description of how snapshot was created Description string