Skip to content

Commit

Permalink
Append newlines to ipfs id and ipfs dns output.
Browse files Browse the repository at this point in the history
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: Thomas Gardner <tmg@fastmail.com>
  • Loading branch information
atomgardner committed Jan 25, 2016
1 parent a5c4c5d commit 7b71698
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/commands/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down
1 change: 1 addition & 0 deletions core/commands/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Expand Down

0 comments on commit 7b71698

Please sign in to comment.