diff --git a/pkg/outputter.go b/pkg/outputter.go index 5f1caed8..2d7fe931 100644 --- a/pkg/outputter.go +++ b/pkg/outputter.go @@ -206,6 +206,7 @@ func parseConfigTemplates(ctx context.Context, c *config.Config, iface *Interfac InterfaceNameCamel string InterfaceNameLowerCamel string InterfaceNameSnake string + InterfaceNameLower string Mock string MockName string PackageName string @@ -217,6 +218,7 @@ func parseConfigTemplates(ctx context.Context, c *config.Config, iface *Interfac InterfaceNameCamel: strcase.ToCamel(iface.Name), InterfaceNameLowerCamel: strcase.ToLowerCamel(iface.Name), InterfaceNameSnake: strcase.ToSnake(iface.Name), + InterfaceNameLower: strings.ToLower(iface.Name), Mock: mock, MockName: c.MockName, PackageName: iface.Pkg.Name(), diff --git a/pkg/outputter_test.go b/pkg/outputter_test.go index 4e224c55..013140f9 100644 --- a/pkg/outputter_test.go +++ b/pkg/outputter_test.go @@ -97,7 +97,7 @@ func Test_parseConfigTemplates(t *testing.T) { args: args{ c: &config.Config{ Dir: "{{.InterfaceDir}}/{{.PackagePath}}", - FileName: "{{.InterfaceName}}_{{.InterfaceNameCamel}}_{{.InterfaceNameSnake}}.go", + FileName: "{{.InterfaceName}}_{{.InterfaceNameCamel}}_{{.InterfaceNameSnake}}_{{.InterfaceNameLower}}.go", MockName: "{{.InterfaceNameLowerCamel}}", Outpkg: "{{.PackageName}}", }, @@ -110,7 +110,7 @@ func Test_parseConfigTemplates(t *testing.T) { pkg: mockPkg, want: &config.Config{ Dir: "path/to/github.com/user/project/package", - FileName: "FooBar_FooBar_foo_bar.go", + FileName: "FooBar_FooBar_foo_bar_foobar.go", MockName: "fooBar", Outpkg: "packageName", },