Add staticcheck fixes (#3221)

* Add staticcheck fixes

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* update golangci-lint version

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2025-05-18 22:27:45 +05:30
committed by GitHub
parent 6cc6498844
commit 2b13af0a5e
58 changed files with 228 additions and 226 deletions
+3 -4
View File
@@ -41,7 +41,7 @@ type GitRepo struct {
// accordingly updates the fields of GitRepo struct and returns it
func NewGitRepo(dirPath string) *GitRepo {
var g *GitRepo = &GitRepo{}
var g = &GitRepo{}
var err error
g.dirPath = dirPath
@@ -102,12 +102,11 @@ The value of the `commit` label for different status of the file is as follows:
func (g *GitRepo) GetFileCommitLabel(filePath string) (string, error) {
if !g.setupDone {
return "", errors.New(`GitRepo is not setup. It has to be created by calling 'NewGitRepo' function,
then this function has to be called.`)
return "", errors.New(`gitrepo is not setup. It has to be created by calling 'NewGitRepo' function, then this function has to be called`)
}
if !g.isGitRepo {
return "", fmt.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