diff --git a/src/cmd/jsondebug/common/helpers.go b/src/cmd/jsondebug/common/helpers.go index 937010d7d..f780540e0 100644 --- a/src/cmd/jsondebug/common/helpers.go +++ b/src/cmd/jsondebug/common/helpers.go @@ -3,6 +3,7 @@ package common import ( "encoding/json" "fmt" + "io" "runtime" "time" ) @@ -99,6 +100,10 @@ type DirectorySummary struct { IgnoredErrorCount int `json:"numIgnoredErrors,omitempty"` } +type ManifestDecoder interface { + Decode(r io.Reader, gcStats bool) error +} + func PrintMemUsage() { var m runtime.MemStats diff --git a/src/cmd/jsondebug/decoder/manifst_decoder.go b/src/cmd/jsondebug/decoder/manifst_decoder.go index 5dc7232da..5c2c5c832 100644 --- a/src/cmd/jsondebug/decoder/manifst_decoder.go +++ b/src/cmd/jsondebug/decoder/manifst_decoder.go @@ -9,6 +9,17 @@ import ( "github.com/alcionai/corso/src/cmd/jsondebug/common" ) +var ( + _ common.ManifestDecoder = Array{} +) + +type Array struct{} + +func (d Array) Decode(r io.Reader, gcStats bool) error { + _, err := DecodeManifestArray(r) + return err +} + func DecodeManifestArray(r io.Reader) (common.Manifest, error) { var ( dec = json.NewDecoder(r)