Skip to content

Commit 1a3fa80

Browse files
committed
Add docs for "commands".Command.Run
To clarify that if you want to access the request body after writing need to use multipart requests. License: MIT Signed-off-by: Jan Winkelmann <[email protected]>
1 parent d5c716a commit 1a3fa80

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

commands/command.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@ type HelpText struct {
5252
// Command is a runnable command, with input arguments and options (flags).
5353
// It can also have Subcommands, to group units of work into sets.
5454
type Command struct {
55-
Options []Option
56-
Arguments []Argument
57-
PreRun func(req Request) error
55+
Options []Option
56+
Arguments []Argument
57+
PreRun func(req Request) error
58+
59+
// Run is the function that processes the request to generate a response.
60+
// Note that when executing the command over the HTTP API you can only read
61+
// after writing when using multipart requests. The request body will not be
62+
// available for reading after the HTTP connection has been written to.
5863
Run Function
5964
PostRun Function
6065
Marshalers map[EncodingType]Marshaler

0 commit comments

Comments
 (0)