Commit 694ab679 authored by Hector Sanjuan's avatar Hector Sanjuan

Golint: unixfs/archive

License: MIT
Signed-off-by: default avatarHector Sanjuan <hector@protocol.ai>
parent 16a54a85
// Package archive provides utilities to archive and compress a [Unixfs] DAG.
package archive
import (
......
// Package tar provides functionality to write a unixfs merkledag
// as a tar archive.
package tar
import (
......@@ -69,6 +71,7 @@ func (w *Writer) writeFile(nd *mdag.ProtoNode, pb *upb.Data, fpath string) error
return nil
}
// WriteNode adds a node to the archive.
func (w *Writer) WriteNode(nd ipld.Node, fpath string) error {
switch nd := nd.(type) {
case *mdag.ProtoNode:
......@@ -106,6 +109,7 @@ func (w *Writer) WriteNode(nd ipld.Node, fpath string) error {
}
}
// Close closes the tar writer.
func (w *Writer) Close() error {
return w.TarW.Close()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment