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

cmds: use w.Write directly

License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
This commit is contained in:
Overbool
2018-11-06 10:18:25 +08:00
committed by Steven Allen
parent 2c48466630
commit 0afbafdeaf
2 changed files with 43 additions and 20 deletions

View File

@ -93,7 +93,7 @@ baz
// error if we aren't running node in online mode
if nd.LocalMode() {
return err
return ErrNotOnline
}
fsdir, found := req.Options[mountIPFSPathOptionName].(string)
@ -120,9 +120,9 @@ baz
Type: config.Mounts{},
Encoders: cmds.EncoderMap{
cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, mounts *config.Mounts) error {
s := fmt.Sprintf("IPFS mounted at: %s\n", mounts.IPFS)
s += fmt.Sprintf("IPNS mounted at: %s\n", mounts.IPNS)
fmt.Fprint(w, s)
fmt.Fprintf(w, "IPFS mounted at: %s\n", mounts.IPFS)
fmt.Fprintf(w, "IPNS mounted at: %s\n", mounts.IPNS)
return nil
}),
},