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
e12c21af
Commit
e12c21af
authored
Mar 11, 2019
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unixfs add: remove StdinName
parent
91f8aac4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
31 deletions
+2
-31
options/unixfs.go
options/unixfs.go
+2
-13
tests/unixfs.go
tests/unixfs.go
+0
-18
No files found.
options/unixfs.go
View file @
e12c21af
...
@@ -34,7 +34,6 @@ type UnixfsAddSettings struct {
...
@@ -34,7 +34,6 @@ type UnixfsAddSettings struct {
NoCopy
bool
NoCopy
bool
Wrap
bool
Wrap
bool
StdinName
string
Events
chan
<-
interface
{}
Events
chan
<-
interface
{}
Silent
bool
Silent
bool
...
@@ -67,7 +66,6 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
...
@@ -67,7 +66,6 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
NoCopy
:
false
,
NoCopy
:
false
,
Wrap
:
false
,
Wrap
:
false
,
StdinName
:
""
,
Events
:
nil
,
Events
:
nil
,
Silent
:
false
,
Silent
:
false
,
...
@@ -245,15 +243,6 @@ func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption {
...
@@ -245,15 +243,6 @@ func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption {
}
}
}
}
// StdinName is the name set for files which don specify FilePath as
// os.Stdin.Name()
func
(
unixfsOpts
)
StdinName
(
name
string
)
UnixfsAddOption
{
return
func
(
settings
*
UnixfsAddSettings
)
error
{
settings
.
StdinName
=
name
return
nil
}
}
// Events specifies channel which will be used to report events about ongoing
// Events specifies channel which will be used to report events about ongoing
// Add operation.
// Add operation.
//
//
...
...
tests/unixfs.go
View file @
e12c21af
...
@@ -292,24 +292,6 @@ func (tp *provider) TestAdd(t *testing.T) {
...
@@ -292,24 +292,6 @@ func (tp *provider) TestAdd(t *testing.T) {
},
},
opts
:
[]
options
.
UnixfsAddOption
{
options
.
Unixfs
.
Wrap
(
true
)},
opts
:
[]
options
.
UnixfsAddOption
{
options
.
Unixfs
.
Wrap
(
true
)},
},
},
{
name
:
"stdinNamed"
,
path
:
"/ipfs/QmQ6cGBmb3ZbdrQW1MRm1RJnYnaxCqfssz7CrTa9NEhQyS"
,
data
:
func
()
files
.
Node
{
rf
,
err
:=
files
.
NewReaderPathFile
(
os
.
Stdin
.
Name
(),
ioutil
.
NopCloser
(
strings
.
NewReader
(
helloStr
)),
nil
)
if
err
!=
nil
{
panic
(
err
)
}
return
rf
},
expect
:
func
(
files
.
Node
)
files
.
Node
{
return
files
.
NewMapDirectory
(
map
[
string
]
files
.
Node
{
"test"
:
files
.
NewBytesFile
([]
byte
(
helloStr
)),
})
},
opts
:
[]
options
.
UnixfsAddOption
{
options
.
Unixfs
.
Wrap
(
true
),
options
.
Unixfs
.
StdinName
(
"test"
)},
},
{
{
name
:
"twoLevelDirWrapped"
,
name
:
"twoLevelDirWrapped"
,
data
:
twoLevelDir
(),
data
:
twoLevelDir
(),
...
...
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