mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-27 07:57:30 +08:00
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>
This commit is contained in:
@ -75,7 +75,7 @@ The resolver will give:
|
|||||||
if !ok {
|
if !ok {
|
||||||
return nil, util.ErrCast()
|
return nil, util.ErrCast()
|
||||||
}
|
}
|
||||||
return strings.NewReader(output.Path.String()), nil
|
return strings.NewReader(output.Path.String() + "\n"), nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Type: ResolvedPath{},
|
Type: ResolvedPath{},
|
||||||
|
@ -133,6 +133,7 @@ ipfs id supports the format option for output with the following keys:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
marshaled = append(marshaled, byte('\n'))
|
||||||
return bytes.NewReader(marshaled), nil
|
return bytes.NewReader(marshaled), nil
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user