1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-15 15:53:41 +00:00

Convert to using github.com/pkg/errors everywhere

This commit is contained in:
Nick Craig-Wood
2016-06-12 15:06:02 +01:00
parent 7fe653c350
commit 4c5b2833b3
32 changed files with 187 additions and 161 deletions

View File

@@ -8,6 +8,8 @@ import (
"hash"
"io"
"strings"
"github.com/pkg/errors"
)
// HashType indicates a standard hashing algorithm
@@ -15,7 +17,7 @@ type HashType int
// ErrHashUnsupported should be returned by filesystem,
// if it is requested to deliver an unsupported hash type.
var ErrHashUnsupported = fmt.Errorf("hash type not supported")
var ErrHashUnsupported = errors.New("hash type not supported")
const (
// HashMD5 indicates MD5 support
@@ -82,7 +84,7 @@ func (h HashType) String() string {
// and this function must support all types.
func hashFromTypes(set HashSet) (map[HashType]hash.Hash, error) {
if !set.SubsetOf(SupportedHashes) {
return nil, fmt.Errorf("Requested set %08x contains unknown hash types", int(set))
return nil, errors.Errorf("requested set %08x contains unknown hash types", int(set))
}
var hashers = make(map[HashType]hash.Hash)
types := set.Array()