diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index f69ea9d4d80..092503374c4 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -26,7 +26,7 @@ import ( iconn "gx/ipfs/QmToCvh5eJtoDheMggre7b2zeFCJ6tAyB82YVs457cqoUE/go-libp2p-interface-conn" ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" "gx/ipfs/QmX3QZ5jHEPidwUrymXV1iSCSUhdGxj15sm2gP4jKMef7B/client_golang/prometheus" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/cmd/ipfs/ipfs.go b/cmd/ipfs/ipfs.go index 0ea990d235d..f03812bedee 100644 --- a/cmd/ipfs/ipfs.go +++ b/cmd/ipfs/ipfs.go @@ -6,7 +6,7 @@ import ( commands "github.com/ipfs/go-ipfs/core/commands" lgc "github.com/ipfs/go-ipfs/commands/legacy" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" ) // This is the CLI root, used for executing commands accessible to CLI clients. diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index 2dea9d7b501..a1497f65424 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -32,9 +32,9 @@ import ( logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log" ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr" osh "gx/ipfs/QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93/go-os-helper" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds/cli" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds/http" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds/cli" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds/http" loggables "gx/ipfs/Qmf9JgVLz46pxPXwG2eWSJpkqVCcjD4rp7zCRi2KP6GTNB/go-libp2p-loggables" ) diff --git a/commands/command.go b/commands/command.go index a89d0d8f533..8d40a27c043 100644 --- a/commands/command.go +++ b/commands/command.go @@ -17,7 +17,7 @@ import ( "github.com/ipfs/go-ipfs/path" logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/command_test.go b/commands/command_test.go index 93c605cc0fc..ee7a37574b6 100644 --- a/commands/command_test.go +++ b/commands/command_test.go @@ -3,7 +3,7 @@ package commands import ( "testing" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/legacy/command.go b/commands/legacy/command.go index 0b0ab23e550..f6a042101fa 100644 --- a/commands/legacy/command.go +++ b/commands/legacy/command.go @@ -3,7 +3,7 @@ package legacy import ( "io" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" oldcmds "github.com/ipfs/go-ipfs/commands" logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log" diff --git a/commands/legacy/legacy.go b/commands/legacy/legacy.go index 3efb7e87b98..84683e34150 100644 --- a/commands/legacy/legacy.go +++ b/commands/legacy/legacy.go @@ -4,7 +4,7 @@ import ( "io" "runtime/debug" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" oldcmds "github.com/ipfs/go-ipfs/commands" ) diff --git a/commands/legacy/legacy_test.go b/commands/legacy/legacy_test.go index 41e6bac0cda..efcbae5a9fd 100644 --- a/commands/legacy/legacy_test.go +++ b/commands/legacy/legacy_test.go @@ -7,7 +7,7 @@ import ( "testing" oldcmds "github.com/ipfs/go-ipfs/commands" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) @@ -78,10 +78,7 @@ func TestNewCommand(t *testing.T) { var env oldcmds.Context - err = root.Call(req, re, &env) - if err != nil { - t.Fatal(err) - } + root.Call(req, re, &env) expected := `{"Value":"Test."} ` diff --git a/commands/legacy/request.go b/commands/legacy/request.go index 7fbffb0cd04..cd353d9b719 100644 --- a/commands/legacy/request.go +++ b/commands/legacy/request.go @@ -7,7 +7,7 @@ import ( "os" "reflect" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" @@ -77,7 +77,7 @@ func (r *requestWrapper) Option(name string) *cmdkit.OptionValue { optDefs, err := r.req.Root.GetOptions(r.req.Path) if err != nil { - return &cmdkit.OptionValue{nil, false, nil} + return &cmdkit.OptionValue{} } for _, def := range optDefs { for _, optName := range def.Names() { @@ -95,11 +95,19 @@ func (r *requestWrapper) Option(name string) *cmdkit.OptionValue { for _, n := range option.Names() { val, found := r.req.Options[n] if found { - return &cmdkit.OptionValue{val, found, option} + return &cmdkit.OptionValue{ + Value: val, + ValueFound: found, + Def: option, + } } } - return &cmdkit.OptionValue{option.Default(), false, option} + return &cmdkit.OptionValue{ + Value: option.Default(), + ValueFound: false, + Def: option, + } } func (r *requestWrapper) Options() cmdkit.OptMap { @@ -127,11 +135,6 @@ func (r *requestWrapper) SetOptions(om cmdkit.OptMap) error { return convertOptions(r.req) } -func (r *requestWrapper) SetRootContext(ctx context.Context) error { - r.req.Context = ctx - return nil -} - func (r *requestWrapper) Stdin() io.Reader { return os.Stdin } diff --git a/commands/legacy/response.go b/commands/legacy/response.go index 6a21044c343..aa55ab189ce 100644 --- a/commands/legacy/response.go +++ b/commands/legacy/response.go @@ -7,7 +7,7 @@ import ( "reflect" "sync" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" oldcmds "github.com/ipfs/go-ipfs/commands" @@ -155,7 +155,7 @@ func (r *fakeResponse) SetOutput(v interface{}) { _, isReader := v.(io.Reader) if t != nil && t.Kind() != reflect.Chan && !isReader { - v = cmds.Single{v} + v = cmds.Single{Value: v} } r.out = v diff --git a/commands/request.go b/commands/request.go index 7fbb8ac0194..4711024ad84 100644 --- a/commands/request.go +++ b/commands/request.go @@ -16,7 +16,7 @@ import ( "github.com/ipfs/go-ipfs/repo/config" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" ) @@ -120,7 +120,6 @@ type Request interface { Files() files.File SetFiles(files.File) Context() context.Context - SetRootContext(context.Context) error InvocContext() *Context SetInvocContext(Context) Command() *Command @@ -161,11 +160,19 @@ func (r *request) Option(name string) *cmdkit.OptionValue { for _, n := range option.Names() { val, found := r.options[n] if found { - return &cmdkit.OptionValue{val, found, option} + return &cmdkit.OptionValue{ + Value: val, + ValueFound: found, + Def: option, + } } } - return &cmdkit.OptionValue{option.Default(), false, option} + return &cmdkit.OptionValue{ + Value: option.Default(), + ValueFound: false, + Def: option, + } } // Options returns a copy of the option map @@ -177,16 +184,6 @@ func (r *request) Options() cmdkit.OptMap { return output } -func (r *request) SetRootContext(ctx context.Context) error { - ctx, err := getContext(ctx, r) - if err != nil { - return err - } - - r.rctx = ctx - return nil -} - // SetOption sets the value of the option for given name. func (r *request) SetOption(name string, val interface{}) { // find the option with the specified name @@ -300,28 +297,6 @@ func (r *request) VarArgs(f func(string) error) error { return nil } -func getContext(base context.Context, req Request) (context.Context, error) { - tout, found, err := req.Option("timeout").String() - if err != nil { - return nil, fmt.Errorf("error parsing timeout option: %s", err) - } - - var ctx context.Context - if found { - duration, err := time.ParseDuration(tout) - if err != nil { - return nil, fmt.Errorf("error parsing timeout option: %s", err) - } - - tctx, _ := context.WithTimeout(base, duration) - ctx = tctx - } else { - cctx, _ := context.WithCancel(base) - ctx = cctx - } - return ctx, nil -} - func (r *request) InvocContext() *Context { return &r.ctx } diff --git a/commands/response.go b/commands/response.go index 5d60ac56fdd..ef4e11af058 100644 --- a/commands/response.go +++ b/commands/response.go @@ -9,7 +9,7 @@ import ( "os" "strings" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/commands/response_test.go b/commands/response_test.go index b2fa3f5443e..300ded7a787 100644 --- a/commands/response_test.go +++ b/commands/response_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/add.go b/core/commands/add.go index bdd7c41aae6..22171d9a597 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -17,8 +17,8 @@ import ( ft "github.com/ipfs/go-ipfs/unixfs" bstore "gx/ipfs/QmTVDM4LCSUMFNQzbDLL9zQwp8usE6QHymFdh3h8vL9v6b/go-ipfs-blockstore" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" files "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files" pb "gx/ipfs/QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs/pb" diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index 1a74b8add00..d5d58f7dea7 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -12,8 +12,8 @@ import ( decision "github.com/ipfs/go-ipfs/exchange/bitswap/decision" "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/block.go b/core/commands/block.go index 4ebad434ca1..b593f562306 100644 --- a/core/commands/block.go +++ b/core/commands/block.go @@ -11,8 +11,8 @@ import ( util "github.com/ipfs/go-ipfs/blocks/blockstoreutil" e "github.com/ipfs/go-ipfs/core/commands/e" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" diff --git a/core/commands/cat.go b/core/commands/cat.go index 6a5cd9cd229..87c1ec4a8f3 100644 --- a/core/commands/cat.go +++ b/core/commands/cat.go @@ -9,7 +9,7 @@ import ( core "github.com/ipfs/go-ipfs/core" coreunix "github.com/ipfs/go-ipfs/core/coreunix" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/commands.go b/core/commands/commands.go index cae5a5a658b..0d2579f8f33 100644 --- a/core/commands/commands.go +++ b/core/commands/commands.go @@ -13,7 +13,7 @@ import ( e "github.com/ipfs/go-ipfs/core/commands/e" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/commands_test.go b/core/commands/commands_test.go index 9415e4d834e..40d24fa3751 100644 --- a/core/commands/commands_test.go +++ b/core/commands/commands_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" ) func collectPaths(prefix string, cmd *cmds.Command, out map[string]struct{}) { diff --git a/core/commands/files.go b/core/commands/files.go index 641b6bc91c5..af0337ceaa4 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -25,8 +25,8 @@ import ( humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format" diff --git a/core/commands/filestore.go b/core/commands/filestore.go index 97364a13974..d8fccb9b8cf 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-ipfs/filestore" lgc "github.com/ipfs/go-ipfs/commands/legacy" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/get.go b/core/commands/get.go index d666f49cf23..e8716f580b4 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -16,7 +16,7 @@ import ( tar "github.com/ipfs/go-ipfs/thirdparty/tar" uarchive "github.com/ipfs/go-ipfs/unixfs/archive" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" "gx/ipfs/QmeWjRodbcZFKe5tMN7poEx3izym6osrLSnTLf9UjJZBbs/pb" ) @@ -247,7 +247,7 @@ func (gw *getWriter) writeExtracted(r io.Reader, fpath string) error { defer bar.Finish() defer bar.Set64(gw.Size) - extractor := &tar.Extractor{fpath, bar.Add64} + extractor := &tar.Extractor{Path: fpath, Progress: bar.Add64} return extractor.Extract(r) } diff --git a/core/commands/get_test.go b/core/commands/get_test.go index 76b3fb533a5..fed427f9721 100644 --- a/core/commands/get_test.go +++ b/core/commands/get_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/helptext_test.go b/core/commands/helptext_test.go index 513d224d27a..039aec89b8c 100644 --- a/core/commands/helptext_test.go +++ b/core/commands/helptext_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" ) func checkHelptextRecursive(t *testing.T, name []string, c *cmds.Command) { diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index e05b4b26d73..9055b222b7e 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -13,7 +13,7 @@ import ( floodsub "gx/ipfs/QmSFihvoND3eDaAYRCeLgLPt62yCPgMZs1NSZmKFEtJQQw/go-libp2p-floodsub" pstore "gx/ipfs/QmXauCuJzmzapetmC6W4TuDJLL1yFFrVzSHoWv8YdbmnxH/go-libp2p-peerstore" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" blocks "gx/ipfs/Qmej7nf81hi2x2tvjRBF3mcp74sQyuDH4VMYDGd1YtXjb2/go-block-format" diff --git a/core/commands/repo.go b/core/commands/repo.go index 9a80975d866..a2a0bb71a94 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -18,7 +18,7 @@ import ( lockfile "github.com/ipfs/go-ipfs/repo/fsrepo/lock" bstore "gx/ipfs/QmTVDM4LCSUMFNQzbDLL9zQwp8usE6QHymFdh3h8vL9v6b/go-ipfs-blockstore" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/root.go b/core/commands/root.go index 225fc7ffbfa..1dfcf15aa02 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -12,7 +12,7 @@ import ( lgc "github.com/ipfs/go-ipfs/commands/legacy" logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log" - "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" + "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" ) diff --git a/core/commands/stat.go b/core/commands/stat.go index a654a05d708..e25b0c6910a 100644 --- a/core/commands/stat.go +++ b/core/commands/stat.go @@ -8,9 +8,9 @@ import ( "time" humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" protocol "gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" peer "gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" cmdkit "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit" metrics "gx/ipfs/QmdeBtQGXjSt7cb97nx9JyLHHv5va2LyEAue7Q5tDFzpLy/go-libp2p-metrics" ) diff --git a/core/coreapi/block.go b/core/coreapi/block.go index a8a691c4d6b..176d562c2bf 100644 --- a/core/coreapi/block.go +++ b/core/coreapi/block.go @@ -111,8 +111,6 @@ func (api *BlockAPI) Rm(ctx context.Context, p coreiface.Path, opts ...caopts.Bl case <-ctx.Done(): return ctx.Err() } - - return nil } func (api *BlockAPI) Stat(ctx context.Context, p coreiface.Path) (coreiface.BlockStat, error) { diff --git a/core/coreapi/object_test.go b/core/coreapi/object_test.go index 1ff90d32de6..a06d0e16591 100644 --- a/core/coreapi/object_test.go +++ b/core/coreapi/object_test.go @@ -268,7 +268,7 @@ func TestObjectAddLinkCreate(t *testing.T) { t.Fatal("expected an error") } if err.Error() != "no link by that name" { - t.Fatal("unexpected error: %s", err.Error()) + t.Fatalf("unexpected error: %s", err.Error()) } p3, err = api.Object().AddLink(ctx, p2, "abc/d", p2, api.Object().WithCreate(true)) diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 2138fa29979..f6869619b4f 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -71,7 +71,7 @@ func (api *UnixfsAPI) Ls(ctx context.Context, p coreiface.Path) ([]*coreiface.Li links := make([]*coreiface.Link, len(ndlinks)) for i, l := range ndlinks { - links[i] = &coreiface.Link{l.Name, l.Size, l.Cid} + links[i] = &coreiface.Link{Name: l.Name, Size: l.Size, Cid: l.Cid} } return links, nil } diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index a77b1bbc289..168667c4c80 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -15,8 +15,8 @@ import ( path "github.com/ipfs/go-ipfs/path" config "github.com/ipfs/go-ipfs/repo/config" - cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds" - cmdsHttp "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds/http" + cmds "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds" + cmdsHttp "gx/ipfs/QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3/go-ipfs-cmds/http" ) var ( diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index 1b94dffba27..89ba5f2f2ed 100644 --- a/core/corehttp/metrics_test.go +++ b/core/corehttp/metrics_test.go @@ -45,6 +45,6 @@ func TestPeersTotal(t *testing.T) { t.Fatalf("expected 1 peers transport, got %d", len(actual)) } if actual["/ip4/tcp"] != float64(3) { - t.Fatalf("expected 3 peers, got %s", actual["/ip4/tcp"]) + t.Fatalf("expected 3 peers, got %f", actual["/ip4/tcp"]) } } diff --git a/package.json b/package.json index 01ed8b0a5b8..cd8b8f46b57 100644 --- a/package.json +++ b/package.json @@ -408,9 +408,9 @@ "version": "2.1.5" }, { - "hash": "QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz", + "hash": "QmabLouZTZwhfALuBcssPvkzhbYGMb4394huT7HY4LQ6d3", "name": "go-ipfs-cmds", - "version": "1.0.5" + "version": "1.0.8" }, { "hash": "QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM",