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
interface-go-dms3-core
Commits
d93b9f11
Commit
d93b9f11
authored
Feb 02, 2019
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi ls: merge ResolveType and ResolveSize
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
a62acc82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
options/unixfs.go
options/unixfs.go
+4
-13
No files found.
options/unixfs.go
View file @
d93b9f11
...
...
@@ -43,8 +43,7 @@ type UnixfsAddSettings struct {
}
type
UnixfsLsSettings
struct
{
ResolveType
bool
ResolveSize
bool
ResolveChildren
bool
}
type
UnixfsAddOption
func
(
*
UnixfsAddSettings
)
error
...
...
@@ -130,8 +129,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
func
UnixfsLsOptions
(
opts
...
UnixfsLsOption
)
(
*
UnixfsLsSettings
,
error
)
{
options
:=
&
UnixfsLsSettings
{
ResolveSize
:
true
,
ResolveType
:
true
,
ResolveChildren
:
true
,
}
for
_
,
opt
:=
range
opts
{
...
...
@@ -313,16 +311,9 @@ func (unixfsOpts) Nocopy(enable bool) UnixfsAddOption {
}
}
func
(
unixfsOpts
)
Resolve
Size
(
resolve
bool
)
UnixfsLsOption
{
func
(
unixfsOpts
)
Resolve
Children
(
resolve
bool
)
UnixfsLsOption
{
return
func
(
settings
*
UnixfsLsSettings
)
error
{
settings
.
ResolveSize
=
resolve
return
nil
}
}
func
(
unixfsOpts
)
ResolveType
(
resolve
bool
)
UnixfsLsOption
{
return
func
(
settings
*
UnixfsLsSettings
)
error
{
settings
.
ResolveType
=
resolve
settings
.
ResolveChildren
=
resolve
return
nil
}
}
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