提交 7b716986 作者: Thomas Gardner

Append newlines to `ipfs id` and `ipfs dns` output.

This fixes #1083, #2000.

N.B. The JSON package developers see no trailing newline as a feature;
it allows marshalled JSON to be embedded inside more JSON.[0]

--
[0] https://golang.org/pkg/encoding/json/

License: MIT
Signed-off-by: 's avatarThomas Gardner <tmg@fastmail.com>
上级 a5c4c5d1
......@@ -75,7 +75,7 @@ The resolver will give:
if !ok {
return nil, util.ErrCast()
}
return strings.NewReader(output.Path.String()), nil
return strings.NewReader(output.Path.String() + "\n"), nil
},
},
Type: ResolvedPath{},
......
......@@ -133,6 +133,7 @@ ipfs id supports the format option for output with the following keys:
if err != nil {
return nil, err
}
marshaled = append(marshaled, byte('\n'))
return bytes.NewReader(marshaled), nil
}
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论