diff options
| author | Jeff Carr <[email protected]> | 2024-01-25 02:23:56 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-25 02:23:56 -0600 |
| commit | 86136ce6152d2125a53fa98adb6e6ed4db949190 (patch) | |
| tree | 25131c5dc1c0fa7f10ee9a30c894d1d185db9e6f /unix.go | |
| parent | 4beeb0bb137bf179064354fa6fc3be2c951bdef6 (diff) | |
avoid a few nil'sv0.13.4
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'unix.go')
| -rw-r--r-- | unix.go | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -222,9 +222,18 @@ func VerifyLocalGoRepo(gorepo string) bool { // Form the path to the home Git directory gitDir := filepath.Join(usr.HomeDir, "go/src/", gorepo, ".git") - log.Log(WARN, "VerifyLocalGoRepo() checking directory:", gitDir) - return IsDirectory(gitDir) + if IsDirectory(gitDir) { + return true + } + goDir := filepath.Join(usr.HomeDir, "go/src/", gorepo) + gomod := goDir + "/go.mod" + log.Log(WARN, "VerifyLocalGoRepo() checking for go.mod :", gomod) + _, err = os.Stat(gomod) + if os.IsNotExist(err) { + return false + } + return true } func readFileToString(filename string) (string, error) { |
