提交 7a36278d 作者: Matt Bell 提交者: Juan Batiz-Benet

commands: Allow setting Request fields in NewRequest

上级 47eea7fd
......@@ -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 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论