1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 23:53:19 +08:00

output + linting

This commit is contained in:
Juan Batiz-Benet
2014-09-20 07:33:20 -07:00
committed by Brian Tiger Chow
parent 6807b6e98e
commit 64ba4cd0df
4 changed files with 5 additions and 3 deletions

View File

@ -26,7 +26,7 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr
nd, err := AddPath(n, path, depth)
if err != nil {
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)
}

View File

@ -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 {
u.POut("Pinning node. Currently No-Op\n")
u.DOut("Pinning node. Currently No-Op\n")
return nil
}

View File

@ -130,7 +130,6 @@ func (n *DAGService) AddRecursive(nd *Node) error {
}
for _, link := range nd.Links {
fmt.Println("Adding link.")
if link.Node == nil {
panic("Why does this node have a nil link?\n")
}

View File

@ -31,6 +31,7 @@ var ErrNotFound = errors.New("Error: Not Found.")
// Key is a string representation of multihash for use with maps.
type Key string
// Pretty returns Key in a b58 encoded string
func (k Key) Pretty() string {
return b58.Encode([]byte(k))
}
@ -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) {
var out []string
for _, p := range paths {