Skip to content
Snippets Groups Projects
Commit 7b716986 authored by Thomas Gardner's avatar Thomas Gardner
Browse files

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: default avatarThomas Gardner <tmg@fastmail.com>
parent a5c4c5d1
Branches
No related tags found
1 merge request!1New
......@@ -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
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment