6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-07 04:20:37 +00:00

Replace deprecated modules

Replace go-homedir with builtin os.UserHomeDir and pkg/errors with
builtin errors
This commit is contained in:
Grzegorz Dlugoszewski
2025-08-11 20:43:49 +02:00
parent 8cd27a8f62
commit 7ecef9c85d
7 changed files with 17 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
package git
import (
"errors"
"fmt"
"os"
"path/filepath"
@@ -9,7 +10,6 @@ import (
"syscall"
"github.com/karrick/godirwalk"
"github.com/pkg/errors"
)
// Max number of concurrently running status loading workers.
@@ -32,12 +32,12 @@ func Exists(path string) (bool, error) {
if err != nil {
if os.IsNotExist(err) {
return false, errors.Wrapf(errDirNotExist, "can't access %s", path)
return false, fmt.Errorf("can't access %s: %w", path, errDirNotExist)
}
}
// Directory exists but can't be accessed
return true, errors.Wrapf(errDirNoAccess, "can't access %s", path)
return true, fmt.Errorf("can't access %s: %w", path, errDirNoAccess)
}
// RepoFinder finds git repositories inside a given path and loads their status.