From 051c33087ba52461d1708da1e18c06bab57af4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 4 Oct 2018 04:07:22 +0200 Subject: [PATCH] coreapi unixfile: simplify RawNode case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Ɓukasz Magiera --- core/coreapi/unixfile.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/core/coreapi/unixfile.go b/core/coreapi/unixfile.go index dcec250cb..f100bbffb 100644 --- a/core/coreapi/unixfile.go +++ b/core/coreapi/unixfile.go @@ -1,11 +1,9 @@ package coreapi import ( - "bytes" "context" "errors" "io" - "io/ioutil" "os" gopath "path" "time" @@ -172,12 +170,6 @@ func newUnixfsFile(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, nam } case *dag.RawNode: - r := ioutil.NopCloser(bytes.NewReader(dn.RawData())) - fi := &sizeInfo{ - size: int64(len(dn.RawData())), - } - - return files.NewReaderFile("", "", r, fi), nil default: return nil, errors.New("unknown node type") }