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
Commits
c89e3c22
Commit
c89e3c22
authored
Jan 12, 2016
by
Christian Couder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands/pin: refactor 'pin ls'
License: MIT Signed-off-by:
Christian Couder
<
chriscool@tuxfamily.org
>
parent
b770c881
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
core/commands/pin.go
core/commands/pin.go
+10
-14
No files found.
core/commands/pin.go
View file @
c89e3c22
...
...
@@ -212,13 +212,18 @@ Example:
}
keys
:=
make
(
map
[
string
]
RefKeyObject
)
if
typeStr
==
"direct"
||
typeStr
==
"all"
{
for
_
,
k
:=
range
n
.
Pinning
.
DirectKeys
()
{
AddToResultKeys
:=
func
(
keyList
[]
key
.
Key
,
typeStr
string
)
{
for
_
,
k
:=
range
keyList
{
keys
[
k
.
B58String
()]
=
RefKeyObject
{
Type
:
"direct"
,
Type
:
typeStr
,
}
}
}
if
typeStr
==
"direct"
||
typeStr
==
"all"
{
AddToResultKeys
(
n
.
Pinning
.
DirectKeys
(),
"direct"
)
}
if
typeStr
==
"indirect"
||
typeStr
==
"all"
{
ks
:=
key
.
NewKeySet
()
for
_
,
k
:=
range
n
.
Pinning
.
RecursiveKeys
()
{
...
...
@@ -232,20 +237,11 @@ Example:
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
}
for
_
,
k
:=
range
ks
.
Keys
()
{
keys
[
k
.
B58String
()]
=
RefKeyObject
{
Type
:
"indirect"
,
}
}
AddToResultKeys
(
ks
.
Keys
(),
"indirect"
)
}
if
typeStr
==
"recursive"
||
typeStr
==
"all"
{
for
_
,
k
:=
range
n
.
Pinning
.
RecursiveKeys
()
{
keys
[
k
.
B58String
()]
=
RefKeyObject
{
Type
:
"recursive"
,
}
}
AddToResultKeys
(
n
.
Pinning
.
RecursiveKeys
(),
"recursive"
)
}
res
.
SetOutput
(
&
RefKeyList
{
Keys
:
keys
})
...
...
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