1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00

turned req + res into interfaces

This commit is contained in:
Juan Batiz-Benet
2014-10-20 11:49:07 -07:00
parent bbef82f4fa
commit b10fc2cc50
6 changed files with 124 additions and 71 deletions

View File

@ -13,10 +13,8 @@ type TestOutput struct {
func TestMarshalling(t *testing.T) {
req := NewEmptyRequest()
res := Response{
req: req,
Value: TestOutput{"beep", "boop", 1337},
}
res := NewResponse(req)
res.SetValue(TestOutput{"beep", "boop", 1337})
// get command global options so we can set the encoding option
cmd := Command{}
@ -31,7 +29,7 @@ func TestMarshalling(t *testing.T) {
}
req.SetOption(EncShort, JSON)
req.convertOptions(options)
req.ConvertOptions(options)
bytes, err := res.Marshal()
if err != nil {