From 6892eba511d9389501d92c683f67242e2ab86bed Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 2 May 2015 08:24:55 -0700 Subject: [PATCH] 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). --- core/commands/internal/slice_util.go | 31 ---------------------------- 1 file changed, 31 deletions(-) delete mode 100644 core/commands/internal/slice_util.go diff --git a/core/commands/internal/slice_util.go b/core/commands/internal/slice_util.go deleted file mode 100644 index cfbdf7181..000000000 --- a/core/commands/internal/slice_util.go +++ /dev/null @@ -1,31 +0,0 @@ -package internal - -import ( - "io" - - u "github.com/ipfs/go-ipfs/util" -) - -func CastToReaders(slice []interface{}) ([]io.Reader, error) { - readers := make([]io.Reader, 0) - for _, arg := range slice { - reader, ok := arg.(io.Reader) - if !ok { - return nil, u.ErrCast() - } - readers = append(readers, reader) - } - return readers, nil -} - -func CastToStrings(slice []interface{}) ([]string, error) { - strs := make([]string, 0) - for _, maybe := range slice { - str, ok := maybe.(string) - if !ok { - return nil, u.ErrCast() - } - strs = append(strs, str) - } - return strs, nil -}