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-unixfs
Commits
79741438
Commit
79741438
authored
Jan 22, 2015
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands: config: Simplified some syntax
parent
3fc9bedb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
core/commands/config.go
core/commands/config.go
+10
-15
No files found.
core/commands/config.go
View file @
79741438
...
...
@@ -68,24 +68,19 @@ Set the value of the 'datastore.path' key:
}
defer
r
.
Close
()
var
value
string
var
err
error
var
output
*
ConfigField
if
len
(
args
)
==
2
{
value
=
args
[
1
]
output
,
err
:=
setConfig
(
r
,
key
,
value
)
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
res
.
SetOutput
(
output
)
value
:=
args
[
1
]
output
,
err
=
setConfig
(
r
,
key
,
value
)
}
else
{
output
,
err
:=
getConfig
(
r
,
key
)
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
res
.
SetOutput
(
output
)
output
,
err
=
getConfig
(
r
,
key
)
}
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
res
.
SetOutput
(
output
)
},
Marshalers
:
cmds
.
MarshalerMap
{
cmds
.
Text
:
func
(
res
cmds
.
Response
)
(
io
.
Reader
,
error
)
{
...
...
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