mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 12:20:03 +08:00
commands: Support outputting <-chan interface{}
This commit is contained in:
@ -50,7 +50,8 @@ func marshalJson(value interface{}) (io.Reader, error) {
|
||||
|
||||
var marshallers = map[EncodingType]Marshaler{
|
||||
JSON: func(res Response) (io.Reader, error) {
|
||||
if ch, ok := res.Output().(chan interface{}); ok {
|
||||
ch, ok := res.Output().(<-chan interface{})
|
||||
if ok {
|
||||
return &ChannelMarshaler{
|
||||
Channel: ch,
|
||||
Marshaler: marshalJson,
|
||||
|
Reference in New Issue
Block a user