error: no go files found in root search path
#636
LandonTClipp
started this conversation in
General
Replies: 2 comments 2 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.
1 reply
-
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.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a discussion thread for this error.
Documentation found here
Beta Was this translation helpful? Give feedback.
All reactions