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

@ -1,8 +1,9 @@
package fs
import (
"fmt"
"io"
"github.com/pkg/errors"
)
// asyncReader will do async read-ahead from the input reader
@ -29,13 +30,13 @@ type asyncReader struct {
// When done use Close to release the buffers and close the supplied input.
func newAsyncReader(rd io.ReadCloser, buffers, size int) (io.ReadCloser, error) {
if size <= 0 {
return nil, fmt.Errorf("buffer size too small")
return nil, errors.New("buffer size too small")
}
if buffers <= 0 {
return nil, fmt.Errorf("number of buffers too small")
return nil, errors.New("number of buffers too small")
}
if rd == nil {
return nil, fmt.Errorf("nil reader supplied")
return nil, errors.New("nil reader supplied")
}
a := &asyncReader{}
a.init(rd, buffers, size)