@@ -40,11 +40,11 @@ type carWriter struct {
4040
4141type WalkFunc func (format.Node ) ([]* format.Link , error )
4242
43- func WriteCar (ctx context.Context , ds format.NodeGetter , roots []cid.Cid , w io.Writer ) error {
44- return WriteCarWithWalker (ctx , ds , roots , w , DefaultWalkFunc )
43+ func WriteCar (ctx context.Context , ds format.NodeGetter , roots []cid.Cid , w io.Writer , options ... merkledag. WalkOption ) error {
44+ return WriteCarWithWalker (ctx , ds , roots , w , DefaultWalkFunc , options ... )
4545}
4646
47- func WriteCarWithWalker (ctx context.Context , ds format.NodeGetter , roots []cid.Cid , w io.Writer , walk WalkFunc ) error {
47+ func WriteCarWithWalker (ctx context.Context , ds format.NodeGetter , roots []cid.Cid , w io.Writer , walk WalkFunc , options ... merkledag. WalkOption ) error {
4848
4949 h := & CarHeader {
5050 Roots : roots ,
@@ -58,7 +58,7 @@ func WriteCarWithWalker(ctx context.Context, ds format.NodeGetter, roots []cid.C
5858 cw := & carWriter {ds : ds , w : w , walk : walk }
5959 seen := cid .NewSet ()
6060 for _ , r := range roots {
61- if err := merkledag .Walk (ctx , cw .enumGetLinks , r , seen .Visit ); err != nil {
61+ if err := merkledag .Walk (ctx , cw .enumGetLinks , r , seen .Visit , options ... ); err != nil {
6262 return err
6363 }
6464 }
0 commit comments