Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
00209184
Commit
00209184
authored
Sep 27, 2015
by
Juan Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1759 from rht/cleanup-coreunix
Cleanup coreunix cat
parents
ce20cf99
a7f43de5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
core/commands/cat.go
core/commands/cat.go
+2
-8
core/coreunix/cat.go
core/coreunix/cat.go
+1
-3
No files found.
core/commands/cat.go
View file @
00209184
...
...
@@ -6,8 +6,7 @@ import (
cmds
"github.com/ipfs/go-ipfs/commands"
core
"github.com/ipfs/go-ipfs/core"
path
"github.com/ipfs/go-ipfs/path"
uio
"github.com/ipfs/go-ipfs/unixfs/io"
coreunix
"github.com/ipfs/go-ipfs/core/coreunix"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/cheggaaa/pb"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
...
...
@@ -68,12 +67,7 @@ func cat(ctx context.Context, node *core.IpfsNode, paths []string) ([]io.Reader,
readers
:=
make
([]
io
.
Reader
,
0
,
len
(
paths
))
length
:=
uint64
(
0
)
for
_
,
fpath
:=
range
paths
{
dagnode
,
err
:=
core
.
Resolve
(
ctx
,
node
,
path
.
Path
(
fpath
))
if
err
!=
nil
{
return
nil
,
0
,
err
}
read
,
err
:=
uio
.
NewDagReader
(
ctx
,
dagnode
,
node
.
DAG
)
read
,
err
:=
coreunix
.
Cat
(
node
,
fpath
)
if
err
!=
nil
{
return
nil
,
0
,
err
}
...
...
core/coreunix/cat.go
View file @
00209184
package
coreunix
import
(
"io"
core
"github.com/ipfs/go-ipfs/core"
path
"github.com/ipfs/go-ipfs/path"
uio
"github.com/ipfs/go-ipfs/unixfs/io"
)
func
Cat
(
n
*
core
.
IpfsNode
,
pstr
string
)
(
io
.
Reader
,
error
)
{
func
Cat
(
n
*
core
.
IpfsNode
,
pstr
string
)
(
*
u
io
.
Dag
Reader
,
error
)
{
p
:=
path
.
FromString
(
pstr
)
dagNode
,
err
:=
n
.
Resolver
.
ResolvePath
(
n
.
Context
(),
p
)
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment