From b97aa787b5645b1482589f66b070af43d81215b3 Mon Sep 17 00:00:00 2001 From: Nicolas Lepage <19571875+nlepage@users.noreply.github.com> Date: Mon, 11 Nov 2019 23:20:19 +0100 Subject: [PATCH] fix embed not working with -o --- cmd/pkger/cmds/pack.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/pkger/cmds/pack.go b/cmd/pkger/cmds/pack.go index bc056a9..cea99da 100644 --- a/cmd/pkger/cmds/pack.go +++ b/cmd/pkger/cmds/pack.go @@ -53,7 +53,7 @@ func (e *packCmd) Exec(args []string) error { return err } - if err := Package(fp, decls); err != nil { + if err := Package(info, fp, decls); err != nil { return err } @@ -123,7 +123,7 @@ func (e *packCmd) Flags() *flag.FlagSet { return e.FlagSet } -func Package(out string, decls parser.Decls) error { +func Package(info here.Info, out string, decls parser.Decls) error { os.RemoveAll(out) defer func() { if err := recover(); err != nil { @@ -146,7 +146,7 @@ func Package(out string, decls parser.Decls) error { fmt.Fprintf(f, "import \"github.com/markbates/pkger/pkging/mem\"\n\n") fmt.Fprintf(f, "\nvar _ = pkger.Apply(mem.UnmarshalEmbed([]byte(`") - if err := pkgutil.Stuff(f, c, decls); err != nil { + if err := pkgutil.Stuff(f, info, decls); err != nil { return err }