Go: Check for modules.txt or glide.yaml to exclude vendor dirs

This commit is contained in:
Michael B. Gale
2025-02-19 13:57:15 +00:00
parent fe4ee54b6f
commit 11e3a08e44

View File

@@ -306,5 +306,6 @@ func fileExists(path string) bool {
// Decides if `dirPath` is a vendor directory by testing whether it is called `vendor`
// and contains a `modules.txt` file.
func IsGolangVendorDirectory(dirPath string) bool {
return filepath.Base(dirPath) == "vendor" && fileExists(filepath.Join(dirPath, "modules.txt"))
return filepath.Base(dirPath) == "vendor" &&
(fileExists(filepath.Join(dirPath, "modules.txt")) || fileExists(filepath.Join(dirPath, "../glide.yaml")))
}