mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-27 13:27:50 +08:00
core/commands: Added a Format function for the 'beep' command
This commit is contained in:
parent
b3ff407d38
commit
edb632a644
@ -48,6 +48,12 @@ Use "ipfs help <command>" for more information about a command.
|
||||
v := TestOutput{"hello, world", 1337}
|
||||
res.SetValue(v)
|
||||
},
|
||||
Format: func(res cmds.Response) (string, error) {
|
||||
v := res.Value().(TestOutput)
|
||||
s := fmt.Sprintf("Foo: %s\n", v.Foo)
|
||||
s += fmt.Sprintf("Bar: %v\n", v.Bar)
|
||||
return s, nil
|
||||
},
|
||||
},
|
||||
"boop": &cmds.Command{
|
||||
Run: func(req cmds.Request, res cmds.Response) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user