diff options
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) { |
