From 6bbf98bef457b4403f27da79eb1861e6197ab539 Mon Sep 17 00:00:00 2001 From: Simon Law Date: Fri, 21 Mar 2025 14:46:02 -0700 Subject: [PATCH] all: skip looking for package comments in .git/ repository (#15384) --- pkgdoc_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgdoc_test.go b/pkgdoc_test.go index be08a358b..0f4a45528 100644 --- a/pkgdoc_test.go +++ b/pkgdoc_test.go @@ -26,6 +26,9 @@ func TestPackageDocs(t *testing.T) { if err != nil { return err } + if fi.Mode().IsDir() && path == ".git" { + return filepath.SkipDir // No documentation lives in .git + } if fi.Mode().IsRegular() && strings.HasSuffix(path, ".go") { if strings.HasSuffix(path, "_test.go") { return nil