From 70c778d84b77e07d66ffadef32c241af681af7a8 Mon Sep 17 00:00:00 2001 From: Landon Clipp Date: Fri, 2 Jun 2023 12:07:44 -0400 Subject: [PATCH] Update notes.md --- docs/notes.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/notes.md b/docs/notes.md index a342854c..f4be3ced 100644 --- a/docs/notes.md +++ b/docs/notes.md @@ -1,6 +1,13 @@ Frequently Asked Questions =========================== +error: `no go files found in root search path` +--------------------------------------------- + +When using the `packages` feature, `recursive: true` and you have specified a package that contains no `*.go` files, mockery is unable to determine the on-disk location of the package in order to continue the recursive package search. This appears to be a limitation of the [golang.org/x/tools/go/packages](https://pkg.go.dev/golang.org/x/tools/go/packages) package that is used to parse package metadata. + +The solution is to create a `.go` file in the package's path and add a `package [name]` directive at the top. It doesn't matter what the file is called. This allows mockery to properly read package metadata. + internal error: package without types was imported ---------------------------------------------------