From 2fd125c489551bfbc523264b107caa3d50aec6d8 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 11 Mar 2016 16:08:21 -0800 Subject: [PATCH] json.RawMessage needs to be a pointer when embedded in a larger JSON struct to avoid double encoding problems. Signed-off-by: David Lawrence (github: endophage) Signed-off-by: David Lawrence (github: endophage) --- tuf/data/types.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tuf/data/types.go b/tuf/data/types.go index b1c706ef5b..becea54f87 100644 --- a/tuf/data/types.go +++ b/tuf/data/types.go @@ -126,9 +126,9 @@ var NotaryDefaultHashes = []string{notary.SHA256, notary.SHA512} // FileMeta contains the size and hashes for a metadata or target file. Custom // data can be optionally added. type FileMeta struct { - Length int64 `json:"length"` - Hashes Hashes `json:"hashes"` - Custom json.RawMessage `json:"custom,omitempty"` + Length int64 `json:"length"` + Hashes Hashes `json:"hashes"` + Custom *json.RawMessage `json:"custom,omitempty"` } // CheckHashes verifies all the checksums specified by the "hashes" of the payload.