Remove github.com/pkg/errors with appropriate replacements (#3172)
* errors.Wrap* removal Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * remove errors.Errorf Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Remove remaining calls Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Few more errors Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * Fix golint errors Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> --------- Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -21,8 +21,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"errors"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type GitRepo struct {
|
||||
@@ -106,13 +107,13 @@ func (g *GitRepo) GetFileCommitLabel(filePath string) (string, error) {
|
||||
}
|
||||
|
||||
if !g.isGitRepo {
|
||||
return "", errors.Errorf(`directory: %s doesn't belong to git repository.`, g.dirPath)
|
||||
return "", fmt.Errorf(`directory: %s doesn't belong to git repository.`, g.dirPath)
|
||||
}
|
||||
|
||||
// filepath in the git repository
|
||||
splitPathList := strings.Split(filePath, g.gitRepoRootPath+string(os.PathSeparator))
|
||||
if len(splitPathList) != 2 {
|
||||
return "", errors.Errorf("error finding the git repository path of %s", filePath)
|
||||
return "", fmt.Errorf("error finding the git repository path of %s", filePath)
|
||||
}
|
||||
gitFilePath := splitPathList[1]
|
||||
gitFileStatus := g.status.File(gitFilePath)
|
||||
|
||||
Reference in New Issue
Block a user