error: no go files found in root search path
#636
Replies: 3 comments 4 replies
-
I have a repo where my main module I want to mock for is a few folders deep. I am getting this error when I place mockery.yaml at the root, even if I have go files at the root. Is there a way I can keep this at the root, rather than in the sub-folder? |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. My solution to this is to create a new main func on my project root. Project structure:
.mockery.yml all: true
testonly: false
inpackage: true
with-expecter: true
dir: mocks/{{ replaceAll .InterfaceDirRelative "internal" "internal_" }}
packages:
my-package:
config:
recursive: true test_spec.go package main
import "my-package/pkg/config"
// this is required to generate mock files
// this file is not used anywhere
func main() {
config.Load("")
} |
Beta Was this translation helpful? Give feedback.
-
Wouldn't it be possible to overcome the go pkg limitation by doing a recursive search, finding all sub directories that contains go files, and then run the command entrypoint for each individual hit? |
Beta Was this translation helpful? Give feedback.
-
This is a discussion thread for this error.
Documentation found here
Beta Was this translation helpful? Give feedback.
All reactions