Copy errors & fs packages from the restic repo and fix import paths

Tedious, but I see no better way...
This commit is contained in:
Zlatko Čalušić
2016-11-05 17:33:34 +01:00
parent 80196e6df6
commit 93d8c2beba
11 changed files with 328 additions and 2 deletions

20
errors/wrap.go Normal file
View File

@@ -0,0 +1,20 @@
package errors
import "github.com/pkg/errors"
// Cause returns the cause of an error.
func Cause(err error) error {
return errors.Cause(err)
}
// New creates a new error based on message. Wrapped so that this package does
// not appear in the stack trace.
var New = errors.New
// Errorf creates an error based on a format string and values. Wrapped so that
// this package does not appear in the stack trace.
var Errorf = errors.Errorf
// Wrap wraps an error retrieved from outside of restic. Wrapped so that this
// package does not appear in the stack trace.
var Wrap = errors.Wrap