Closed fatahTop closed 6 months ago
Are you using the packages
config feature?
https://vektra.github.io/mockery/v2.37/configuration/#templated-strings
From the docs:
Templated variables are only available when using the packages config feature.
Ah i see it worked fine using package config sorry my bad
Description
I just try mockery out and using the binary .exe for windows as recommended by the docs then I create config file .mockery.yaml on top root of my project repo as follows:
When I try to generate mockery using the command mockery --name Foo I got the file named { .InterfaceName }}_mock.go instead of Foo_mock.go, I don't know what went wrong I just try this out. It works fine if I don't use the config file or specify the filename in config but I want to be able to customize the filename generated.
I also tried cmd ways:
mockery --name Foo --filename "{{ .InterfaceName }}_mock.go"
but got the same result.I also tried to use camelcase like
"{{ .InterfaceName | camelcase }}_mock.go"
but got error:Mockery Version
mockery_2.37.1_Windows_x86_64
Golang Version
go1.21.3
Installation Method
Steps to Reproduce
Expected Behavior
It result with filename Foo_mock.go
Actual Behavior
{{ .InterfaceName }}_mock.go