mirror of
https://github.com/ipfs/kubo.git
synced 2025-10-17 11:43:31 +08:00
commands: Changed Marshaler to return a io.Reader instead of a []byte
core/commands: Refactored command marshalers
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
cmds "github.com/jbenet/go-ipfs/commands"
|
||||
u "github.com/jbenet/go-ipfs/util"
|
||||
)
|
||||
@ -90,6 +93,6 @@ type MessageOutput struct {
|
||||
Message string
|
||||
}
|
||||
|
||||
func MessageTextMarshaler(res cmds.Response) ([]byte, error) {
|
||||
return []byte(res.Output().(*MessageOutput).Message), nil
|
||||
func MessageTextMarshaler(res cmds.Response) (io.Reader, error) {
|
||||
return strings.NewReader(res.Output().(*MessageOutput).Message), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user