Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
b4325537
Commit
b4325537
authored
Mar 26, 2020
by
deepakgarg
Browse files
Options
Browse Files
Download
Plain Diff
Fixes #183. Refactored the method signature as commented on the PR
parents
ee80c8ee
90843374
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
request.go
request.go
+13
-0
No files found.
request.go
View file @
b4325537
...
...
@@ -24,12 +24,17 @@ type Request struct {
// NewRequest returns a request initialized with given arguments
// An non-nil error will be returned if the provided option values are invalid
<<<<<<<
HEAD
func
NewRequest
(
ctx
context
.
Context
,
path
[]
string
,
opts
OptMap
,
args
[]
string
,
file
files
.
Directory
,
root
*
Command
,
)
(
*
Request
,
error
)
{
=======
func
NewRequest
(
ctx
context
.
Context
,
path
[]
string
,
opts
OptMap
,
args
[]
string
,
file
files
.
Directory
,
root
*
Command
)
(
*
Request
,
error
)
{
>>>>>>>
90843374
f694708a997c8e6e4d15142610c50cbf
if
opts
==
nil
{
opts
=
make
(
OptMap
)
}
...
...
@@ -39,7 +44,11 @@ func NewRequest(ctx context.Context,
return
nil
,
err
}
<<<<<<<
HEAD
err
=
checkAndConvertOptions
(
root
,
opts
,
path
)
=======
err
=
convertOptions
(
root
,
opts
,
path
)
>>>>>>>
90843374
f694708a997c8e6e4d15142610c50cbf
req
:=
&
Request
{
Path
:
path
,
Options
:
opts
,
...
...
@@ -100,7 +109,11 @@ func (req *Request) SetOption(name string, value interface{}) {
return
}
<<<<<<<
HEAD
func
checkAndConvertOptions
(
root
*
Command
,
opts
OptMap
,
path
[]
string
)
error
{
=======
func
convertOptions
(
root
*
Command
,
opts
OptMap
,
path
[]
string
)
error
{
>>>>>>>
90843374
f694708a997c8e6e4d15142610c50cbf
optDefs
,
err
:=
root
.
GetOptions
(
path
)
if
err
!=
nil
{
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment