Commit e12c21af authored by Łukasz Magiera's avatar Łukasz Magiera

unixfs add: remove StdinName

parent 91f8aac4
......@@ -34,7 +34,6 @@ type UnixfsAddSettings struct {
NoCopy bool
Wrap bool
StdinName string
Events chan<- interface{}
Silent bool
......@@ -67,7 +66,6 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
NoCopy: false,
Wrap: false,
StdinName: "",
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.
//
......
......@@ -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(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment