提交 01d2c78f 作者: Kevin Atkinson

Tweak API.

License: MIT
Signed-off-by: 's avatarKevin Atkinson <k@kevina.org>
上级 b6fcfc87
...@@ -77,7 +77,7 @@ The JSON output contains type information. ...@@ -77,7 +77,7 @@ The JSON output contains type information.
return return
} }
_, _, ctx, err := HandleCidBaseOld(req) _, _, ctx, err := HandleCidBaseOld(req, req.Context())
if err != nil { if err != nil {
res.SetError(err, cmdkit.ErrNormal) res.SetError(err, cmdkit.ErrNormal)
return return
......
...@@ -87,7 +87,7 @@ Resolve the value of an IPFS DAG path: ...@@ -87,7 +87,7 @@ Resolve the value of an IPFS DAG path:
name := req.Arguments()[0] name := req.Arguments()[0]
recursive, _, _ := req.Option("recursive").Bool() recursive, _, _ := req.Option("recursive").Bool()
_, _, ctx, err := HandleCidBaseOld(req) _, _, ctx, err := HandleCidBaseOld(req, req.Context())
if err != nil { if err != nil {
res.SetError(err, cmdkit.ErrNormal) res.SetError(err, cmdkit.ErrNormal)
return return
......
...@@ -242,9 +242,8 @@ func HandleCidBase(req *cmds.Request, env cmds.Environment) (mbase.Encoder, bool ...@@ -242,9 +242,8 @@ func HandleCidBase(req *cmds.Request, env cmds.Environment) (mbase.Encoder, bool
// HandleCidBaseFlagOld is like HandleCidBase but works with the old // HandleCidBaseFlagOld is like HandleCidBase but works with the old
// commands interface. Since it is not possible to change the context // commands interface. Since it is not possible to change the context
// using this interface and new context is returned instead. // using this interface and new context is returned instead.
func HandleCidBaseOld(req oldcmds.Request) (mbase.Encoder, bool, context.Context, error) { func HandleCidBaseOld(req oldcmds.Request, ctx context.Context) (mbase.Encoder, bool, context.Context, error) {
baseStr, _, _ := req.Option("cid-base").String() baseStr, _, _ := req.Option("cid-base").String()
ctx := req.Context()
if baseStr != "" { if baseStr != "" {
encoder, err := mbase.EncoderByName(baseStr) encoder, err := mbase.EncoderByName(baseStr)
if err != nil { if err != nil {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论