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
Hide 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
...
...
@@ -33,8 +33,7 @@ type UnixfsAddSettings struct {
FsCache
bool
NoCopy
bool
Wrap
bool
StdinName
string
Wrap
bool
Events
chan
<-
interface
{}
Silent
bool
...
...
@@ -66,8 +65,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
FsCache
:
false
,
NoCopy
:
false
,
Wrap
:
false
,
StdinName
:
""
,
Wrap
:
false
,
Events
:
nil
,
Silent
:
false
,
...
...
@@ -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
// Add operation.
//
...
...
tests/unixfs.go
View file @
e12c21af
...
...
@@ -292,24 +292,6 @@ func (tp *provider) TestAdd(t *testing.T) {
},
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",
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