Skip to content

Commit

Permalink
cmds/refs: remove redundant func
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Overbool <[email protected]>
  • Loading branch information
overbool committed Nov 6, 2018
1 parent b1ed7f5 commit e90b2f4
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions core/commands/refs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package commands

import (
"bytes"
"context"
"errors"
"fmt"
Expand All @@ -15,8 +14,8 @@ import (

cid "gx/ipfs/QmR8BauakNcBa3RbE4nbQu76PDiJgoQgz8AJdhJuiU4TAw/go-cid"
path "gx/ipfs/QmRG3XuGwT7GYuAqgWDJBKTzdaHMwAnc1x7J2KHEXNHxzG/go-path"
cmds "gx/ipfs/Qma6uuSyjkecGhMFFLfzyJDPyoDtNJSHJNweDccZhaWkgU/go-ipfs-cmds"
ipld "gx/ipfs/QmcKKBwfz6FyQdHR2jsXrrF6XeSBXYL86anmWNewpFpoF5/go-ipld-format"
cmds "gx/ipfs/QmSXUokcP4TJpFfqozT69AVAYRtzXVMUjzQVkYX41R9Svs/go-ipfs-cmds"
cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit"
)

Expand All @@ -33,25 +32,6 @@ const (
refsMaxDepthOptionName = "max-depth"
)

// KeyListTextMarshaler outputs a KeyList as plaintext, one key per line
func KeyListTextMarshaler(res oldcmds.Response) (io.Reader, error) {
out, err := unwrapOutput(res.Output())
if err != nil {
return nil, err
}

output, ok := out.(*KeyList)
if !ok {
return nil, e.TypeErr(output, out)
}

buf := new(bytes.Buffer)
for _, key := range output.Keys {
buf.WriteString(key.String() + "\n")
}
return buf, nil
}

var RefsCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "List links (references) from an object.",
Expand Down

0 comments on commit e90b2f4

Please sign in to comment.