Skip to content

Commit

Permalink
Merge pull request #773 from istrau2/patch-1
Browse files Browse the repository at this point in the history
Added InterfaceFile
  • Loading branch information
LandonTClipp committed Apr 29, 2024
2 parents b1c5f6e + 314f11a commit 25d2eb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/outputter.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func parseConfigTemplates(ctx context.Context, c *config.Config, iface *Interfac
data := struct {
InterfaceDir string
InterfaceDirRelative string
InterfaceFile string
InterfaceName string
InterfaceNameCamel string
InterfaceNameLowerCamel string
Expand All @@ -222,6 +223,7 @@ func parseConfigTemplates(ctx context.Context, c *config.Config, iface *Interfac
}{
InterfaceDir: filepath.Dir(iface.FileName),
InterfaceDirRelative: interfaceDirRelative,
InterfaceFile: iface.FileName,
InterfaceName: iface.Name,
// Deprecated: All custom case variables of InterfaceName will be removed in the next major version
// Use the template functions instead
Expand Down
4 changes: 2 additions & 2 deletions pkg/outputter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func Test_parseConfigTemplates(t *testing.T) {
args: args{
c: &config.Config{
Dir: "{{.InterfaceDir}}/{{.PackagePath}}",
FileName: "{{.InterfaceName}}_{{.InterfaceNameCamel}}_{{.InterfaceNameSnake}}_{{.InterfaceNameLower}}.go",
FileName: "{{.InterfaceName}}_{{.InterfaceNameCamel}}_{{.InterfaceNameSnake}}_{{.InterfaceNameLower}}_{{base .InterfaceFile}}",
MockName: "{{.InterfaceNameLowerCamel}}",
Outpkg: "{{.PackageName}}",
},
Expand All @@ -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_foobar.go",
FileName: "FooBar_FooBar_foo_bar_foobar_foobar.go",
MockName: "fooBar",
Outpkg: "packageName",
},
Expand Down

0 comments on commit 25d2eb0

Please sign in to comment.