unixfs add: remove StdinName
This commit was moved from ipfs/interface-go-ipfs-core@e12c21afc03931525ceefc18be0bda8c71818d29 This commit was moved from ipfs/boxo@f3f74adfdbb7715898650b91985c61e3ba7a2788
Łukasz Magiera committed
Mar 11, 2019 at 15:58 UTC
905898b66787e0970c3e26f1072e8d2471c644db
2 files changed
+2
-31
core/coreiface/options/unixfs.go
+2
-13
@@ -33,8 +33,7 @@ type UnixfsAddSettings struct {
33
FsCache bool
34
NoCopy bool
35
36
- Wrap bool
37
- StdinName string
36
+ Wrap bool
37
38
Events chan<- interface{}
39
Silent bool
@@ -66,8 +65,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
65
FsCache: false,
66
NoCopy: false,
67
69
- Wrap: false,
70
- StdinName: "",
68
+ Wrap: false,
69
70
Events: nil,
71
Silent: false,
@@ -245,15 +243,6 @@ func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption {
243
}
244
}
245
248
-// StdinName is the name set for files which don specify FilePath as
249
-// os.Stdin.Name()
250
-func (unixfsOpts) StdinName(name string) UnixfsAddOption {
251
- return func(settings *UnixfsAddSettings) error {
252
- settings.StdinName = name
253
- return nil
254
- }
255
-}
256
-
246
// Events specifies channel which will be used to report events about ongoing
247
// Add operation.
248
//
core/coreiface/tests/unixfs.go
-18
@@ -292,24 +292,6 @@ func (tp *provider) TestAdd(t *testing.T) {
292
},
293
opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)},
294
},
295
- {
296
- name: "stdinNamed",
297
- path: "/ipfs/QmQ6cGBmb3ZbdrQW1MRm1RJnYnaxCqfssz7CrTa9NEhQyS",
298
- data: func() files.Node {
299
- rf, err := files.NewReaderPathFile(os.Stdin.Name(), ioutil.NopCloser(strings.NewReader(helloStr)), nil)
300
- if err != nil {
301
- panic(err)
302
- }
303
-
304
- return rf
305
- },
306
- expect: func(files.Node) files.Node {
307
- return files.NewMapDirectory(map[string]files.Node{
308
- "test": files.NewBytesFile([]byte(helloStr)),
309
- })
310
- },
311
- opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true), options.Unixfs.StdinName("test")},
312
- },
295
{
296
name: "twoLevelDirWrapped",
297
data: twoLevelDir(),