From aa68249f3b13be84bd6431c56f0ef1597af3042d Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Mon, 11 Dec 2023 15:04:42 +0000 Subject: [PATCH] fix: CAR encode with empty roots --- core/car/car.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/car/car.go b/core/car/car.go index 0d5367b..5d5ef1d 100644 --- a/core/car/car.go +++ b/core/car/car.go @@ -22,7 +22,7 @@ const ContentType = "application/vnd.ipld.car" func Encode(roots []ipld.Link, blocks iterable.Iterator[ipld.Block]) io.Reader { reader, writer := io.Pipe() go func() { - var cids []cid.Cid + cids := []cid.Cid{} for _, r := range roots { _, cid, err := cid.CidFromBytes([]byte(r.Binary())) if err != nil {