From 18527455989abe5c3d07ad28f81e89f91daa5bb3 Mon Sep 17 00:00:00 2001 From: Banana Duck Date: Fri, 27 Dec 2024 16:14:32 +0300 Subject: [PATCH] Fix: warning everytime when `issue-845-fix: True`. Fixes mockery/mockery#862 --- pkg/generator.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/generator.go b/pkg/generator.go index bcda68cb..c424e6d7 100644 --- a/pkg/generator.go +++ b/pkg/generator.go @@ -423,7 +423,8 @@ func (g *Generator) generateImports(ctx context.Context) { func (g *Generator) GeneratePrologue(ctx context.Context, pkg string) { g.populateImports(ctx) - if !g.config.Issue845Fix { + // If both `inpackage` and `outpkg` are set warn + if g.config.InPackage && g.config.Outpkg != "" { logging.WarnDeprecated( ctx, "issue-845-fix must be set to True to remove this warning. Visit the link for more details.", @@ -431,6 +432,9 @@ func (g *Generator) GeneratePrologue(ctx context.Context, pkg string) { "url": logging.DocsURL("/deprecations/#issue-845-fix"), }, ) + } + + if !g.config.Issue845Fix { if g.config.InPackage { g.printf("package %s\n\n", g.iface.Pkg.Name()) } else {