@cryptotaxi247 / kubo / commits / 6892eba51

core/commands/internal/slice_util: Remove this unused package

The last references to CastToReaders were commented out in 6faeee83 (cmds2/add: temp fix for -r. horrible hack, 2014-11-11) and then removed completely in 032e9c29 (core/commands2: Updated 'add' command for new file API, 2014-11-16). The last references to CastToStrings was removed in a0bd29d5 (core/commands2: Fixed swarm command for new arguments API, 2014-11-18).

W. Trevor King committed May 2, 2015 at 08:24 UTC 6892eba511d9389501d92c683f67242e2ab86bed
1 file changed -31
core/commands/internal/slice_util.go deleted
-31
@@ -1,31 +0,0 @@
1 -package internal
2 -
3 -import (
4 - "io"
5 -
6 - u "github.com/ipfs/go-ipfs/util"
7 -)
8 -
9 -func CastToReaders(slice []interface{}) ([]io.Reader, error) {
10 - readers := make([]io.Reader, 0)
11 - for _, arg := range slice {
12 - reader, ok := arg.(io.Reader)
13 - if !ok {
14 - return nil, u.ErrCast()
15 - }
16 - readers = append(readers, reader)
17 - }
18 - return readers, nil
19 -}
20 -
21 -func CastToStrings(slice []interface{}) ([]string, error) {
22 - strs := make([]string, 0)
23 - for _, maybe := range slice {
24 - str, ok := maybe.(string)
25 - if !ok {
26 - return nil, u.ErrCast()
27 - }
28 - strs = append(strs, str)
29 - }
30 - return strs, nil
31 -}