1
0
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:
Matt Bell
2015-01-20 12:38:00 -08:00
committed by Jeromy
parent 9adcfe7bc2
commit 31ae178078
6 changed files with 18 additions and 4 deletions

View File

@ -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,