From 6551ec4d7383b20aa7c5f7fde50defcea70c0c22 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 20 Jun 2022 12:02:12 +0200 Subject: [PATCH] feat: ignore testdata and vendor directories --- mocktail.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mocktail.go b/mocktail.go index de92981..ef3547e 100644 --- a/mocktail.go +++ b/mocktail.go @@ -77,7 +77,15 @@ func walk(modulePath, moduleName string) (map[string]PackageDesc, error) { return err } - if d.IsDir() || d.Name() != srcMockFile { + if d.IsDir() { + if d.Name() == "testdata" || d.Name() == "vendor" { + return filepath.SkipDir + } + + return nil + } + + if d.Name() != srcMockFile { return nil }