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: Thomas Gardner <tmg@fastmail.com>
Thomas Gardner committed
Jan 24, 2016 at 10:34 UTC
7b716986f67db2ab87223b6b39d3dad96cf14a7e
2 files changed
+2
-1
core/commands/dns.go
+1
-1
@@ -75,7 +75,7 @@ The resolver will give:
75
if !ok {
76
return nil, util.ErrCast()
77
}
78
- return strings.NewReader(output.Path.String()), nil
78
+ return strings.NewReader(output.Path.String() + "\n"), nil
79
},
80
},
81
Type: ResolvedPath{},
core/commands/id.go
+1
@@ -133,6 +133,7 @@ ipfs id supports the format option for output with the following keys:
133
if err != nil {
134
return nil, err
135
}
136
+ marshaled = append(marshaled, byte('\n'))
137
return bytes.NewReader(marshaled), nil
138
}
139
},