core/coreunix: Documented return values

This commit is contained in:
Matt Bell 2015-02-02 10:13:33 -08:00
parent 54fef5ea96
commit e5f3ac99c3

View File

@ -67,6 +67,8 @@ func AddR(n *core.IpfsNode, root string) (key string, err error) {
// AddWrapped adds data from a reader, and wraps it with a directory object
// to preserve the filename.
// Returns the path of the added file ("<dir hash>/filename"), the DAG node of
// the directory, and and error if any.
func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, *merkledag.Node, error) {
file := files.NewReaderFile(filename, ioutil.NopCloser(r), nil)
dir := files.NewSliceFile("", []files.File{file})