Commit 45b54c78 authored by Jeromy Johnson's avatar Jeromy Johnson

Merge pull request #1183 from wking/remove-core-commands-internal-slice_util

core/commands/internal/slice_util: Remove this unused package
parents 29fae23d 6892eba5
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