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:
Sanket Sudake
2025-02-20 08:58:37 +05:30
committed by GitHub
parent 2fd44174ce
commit caffed92f4
113 changed files with 585 additions and 588 deletions
+4 -3
View File
@@ -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)