Commit 6892eba5 authored by W. Trevor King's avatar W. Trevor King

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).
parent b1183099
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
}
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