switched fmt.Errorf() to errors.Wrap()

This commit is contained in:
Jarek Kowalski
2019-05-11 10:22:40 -07:00
parent 440a1de2b2
commit a6a153b22e
36 changed files with 123 additions and 106 deletions

View File

@@ -2,13 +2,13 @@
import (
"context"
"fmt"
"os"
"strings"
"github.com/kopia/kopia/internal/diff"
"github.com/kopia/kopia/snapshot/snapshotfs"
"github.com/kopia/repo"
"github.com/pkg/errors"
)
var (
@@ -32,7 +32,7 @@ func runDiffCommand(ctx context.Context, rep *repo.Repository) error {
isDir1 := strings.HasPrefix(string(oid1), "k")
isDir2 := strings.HasPrefix(string(oid2), "k")
if isDir1 != isDir2 {
return fmt.Errorf("arguments do diff must both be directories or both non-directories")
return errors.New("arguments do diff must both be directories or both non-directories")
}
d, err := diff.NewComparer(rep, os.Stdout)
@@ -55,7 +55,7 @@ func runDiffCommand(ctx context.Context, rep *repo.Repository) error {
)
}
return fmt.Errorf("comparing files not implemented yet")
return errors.New("comparing files not implemented yet")
}
func defaultDiffCommand() string {