Commit a75ed547 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

commands: Allow setting Request fields in NewRequest

parent 9eae278e
......@@ -96,10 +96,15 @@ func (r *Request) convertOptions(options map[string]Option) error {
return nil
}
func NewRequest() *Request {
return &Request{
make([]string, 0),
make(map[string]interface{}),
make([]string, 0),
func NewRequest(path []string, opts map[string]interface{}, args []string) *Request {
if path == nil {
path = make([]string, 0)
}
if opts == nil {
opts = make(map[string]interface{})
}
if args == nil {
args = make([]string, 0)
}
return &Request{path, opts, args}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment