提交 64ba4cd0 作者: Juan Batiz-Benet 提交者: Brian Tiger Chow

output + linting

上级 6807b6e9
...@@ -26,7 +26,7 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr ...@@ -26,7 +26,7 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr
nd, err := AddPath(n, path, depth) nd, err := AddPath(n, path, depth)
if err != nil { if err != nil {
if err == ErrDepthLimitExceeded && depth == 1 { if err == ErrDepthLimitExceeded && depth == 1 {
err = errors.New("use -r to recursively add directories.") err = errors.New("use -r to recursively add directories")
} }
return fmt.Errorf("addFile error: %v", err) return fmt.Errorf("addFile error: %v", err)
} }
......
...@@ -207,7 +207,8 @@ func initConnections(cfg *config.Config, route *dht.IpfsDHT) { ...@@ -207,7 +207,8 @@ func initConnections(cfg *config.Config, route *dht.IpfsDHT) {
} }
} }
// PinDagNode ensures a given node is stored persistently locally.
func (n *IpfsNode) PinDagNode(nd *merkledag.Node) error { func (n *IpfsNode) PinDagNode(nd *merkledag.Node) error {
u.POut("Pinning node. Currently No-Op\n") u.DOut("Pinning node. Currently No-Op\n")
return nil return nil
} }
...@@ -130,7 +130,6 @@ func (n *DAGService) AddRecursive(nd *Node) error { ...@@ -130,7 +130,6 @@ func (n *DAGService) AddRecursive(nd *Node) error {
} }
for _, link := range nd.Links { for _, link := range nd.Links {
fmt.Println("Adding link.")
if link.Node == nil { if link.Node == nil {
panic("Why does this node have a nil link?\n") panic("Why does this node have a nil link?\n")
} }
......
...@@ -31,6 +31,7 @@ var ErrNotFound = errors.New("Error: Not Found.") ...@@ -31,6 +31,7 @@ var ErrNotFound = errors.New("Error: Not Found.")
// Key is a string representation of multihash for use with maps. // Key is a string representation of multihash for use with maps.
type Key string type Key string
// Pretty returns Key in a b58 encoded string
func (k Key) Pretty() string { func (k Key) Pretty() string {
return b58.Encode([]byte(k)) return b58.Encode([]byte(k))
} }
...@@ -80,6 +81,7 @@ func DOut(format string, a ...interface{}) { ...@@ -80,6 +81,7 @@ func DOut(format string, a ...interface{}) {
} }
} }
// ExpandPathnames takes a set of paths and turns them into absolute paths
func ExpandPathnames(paths []string) ([]string, error) { func ExpandPathnames(paths []string) ([]string, error) {
var out []string var out []string
for _, p := range paths { for _, p := range paths {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论