From 7b2f4488b7430f0a1d28ecf6a76b46feaeff5864 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 28 Oct 2014 22:20:35 -0700 Subject: [PATCH] core/commands: Added Type to 'beep' command --- core/commands/root.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/commands/root.go b/core/commands/root.go index 245a955b0..e957e7a90 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -45,15 +45,16 @@ Use "ipfs help " for more information about a command. Subcommands: map[string]*cmds.Command{ "beep": &cmds.Command{ Run: func(req cmds.Request, res cmds.Response) { - v := TestOutput{"hello, world", 1337} + v := &TestOutput{"hello, world", 1337} res.SetValue(v) }, Format: func(res cmds.Response) (string, error) { - v := res.Value().(TestOutput) + v := res.Value().(*TestOutput) s := fmt.Sprintf("Foo: %s\n", v.Foo) s += fmt.Sprintf("Bar: %v\n", v.Bar) return s, nil }, + Type: &TestOutput{}, }, "boop": &cmds.Command{ Run: func(req cmds.Request, res cmds.Response) {