Skip to content

Commit

Permalink
cmds/pin: fix pin imports
Browse files Browse the repository at this point in the history
* Name them. Unfortunately, This makes the *actual* package names clear. I know
  this isn't "idiomatic go" but it's idiomatic go-ipfs.
* Remove the duplicate import.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
  • Loading branch information
Stebalien committed Jan 29, 2019
1 parent 7a08cf9 commit e2ab620
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions core/commands/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ import (
"os"
"time"

"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core/commands/cmdenv"
"github.com/ipfs/go-ipfs/core/commands/e"
"github.com/ipfs/go-ipfs/core/coreapi/interface"
core "github.com/ipfs/go-ipfs/core"
cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
e "github.com/ipfs/go-ipfs/core/commands/e"
coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface"
"github.com/ipfs/go-ipfs/core/coreapi/interface/options"
"github.com/ipfs/go-ipfs/pin"
options "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
pin "github.com/ipfs/go-ipfs/pin"

"gx/ipfs/QmR8BauakNcBa3RbE4nbQu76PDiJgoQgz8AJdhJuiU4TAw/go-cid"
cid "gx/ipfs/QmR8BauakNcBa3RbE4nbQu76PDiJgoQgz8AJdhJuiU4TAw/go-cid"
bserv "gx/ipfs/QmVKQHuzni68SWByzJgBUCwHvvr4TWiXfutNWWwpZpp4rE/go-blockservice"
"gx/ipfs/QmWGm4AbZEbnmdgVTza52MSNpEmBdFVqzmAysRbjrRyGbH/go-ipfs-cmds"
"gx/ipfs/QmYMQuypUbgsdNHmuCBSUJV6wdQVsBHRivNAp3efHJwZJD/go-verifcid"
"gx/ipfs/QmYZwey1thDTynSrvd6qQkX24UpTka6TFhQ2v569UpoqxD/go-ipfs-exchange-offline"
cmds "gx/ipfs/QmWGm4AbZEbnmdgVTza52MSNpEmBdFVqzmAysRbjrRyGbH/go-ipfs-cmds"
verifcid "gx/ipfs/QmYMQuypUbgsdNHmuCBSUJV6wdQVsBHRivNAp3efHJwZJD/go-verifcid"
offline "gx/ipfs/QmYZwey1thDTynSrvd6qQkX24UpTka6TFhQ2v569UpoqxD/go-ipfs-exchange-offline"
dag "gx/ipfs/Qmb2UEG2TAeVrEJSjqsZF7Y2he7wRDkrdt6c3bECxwZf4k/go-merkledag"
"gx/ipfs/QmdPQx9fvN5ExVwMhRmh7YpCQJzJrFhd1AjVBwJmRMFJeX/go-cidutil/cidenc"
"gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit"
cidenc "gx/ipfs/QmdPQx9fvN5ExVwMhRmh7YpCQJzJrFhd1AjVBwJmRMFJeX/go-cidutil/cidenc"
cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit"
)

var PinCmd = &cmds.Command{
Expand Down Expand Up @@ -418,12 +417,12 @@ new pin and removing the old one.

unpin, _ := req.Options[pinUnpinOptionName].(bool)

from, err := iface.ParsePath(req.Arguments[0])
from, err := coreiface.ParsePath(req.Arguments[0])
if err != nil {
return err
}

to, err := iface.ParsePath(req.Arguments[1])
to, err := coreiface.ParsePath(req.Arguments[1])
if err != nil {
return err
}
Expand Down Expand Up @@ -505,7 +504,7 @@ type RefKeyList struct {
Keys map[string]RefKeyObject
}

func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsNode, api iface.CoreAPI) (map[cid.Cid]RefKeyObject, error) {
func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsNode, api coreiface.CoreAPI) (map[cid.Cid]RefKeyObject, error) {

mode, ok := pin.StringToMode(typeStr)
if !ok {
Expand All @@ -515,7 +514,7 @@ func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsN
keys := make(map[cid.Cid]RefKeyObject)

for _, p := range args {
pth, err := iface.ParsePath(p)
pth, err := coreiface.ParsePath(p)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e2ab620

Please sign in to comment.