From 4e1fe7b43f4b8575de9c86b101056ecb16a9e723 Mon Sep 17 00:00:00 2001 From: Hannes Gustafsson Date: Sun, 16 Feb 2020 19:49:51 +0000 Subject: [PATCH] Add generated code disclaimer Generated code should contain a disclaimer as per [1]. Add a disclaimer to the top of the file generated by the pack command. Fixes #68. [1] https://golang.org/s/generatedcode --- cmd/pkger/cmds/pack.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/pkger/cmds/pack.go b/cmd/pkger/cmds/pack.go index 3961643..4b478eb 100644 --- a/cmd/pkger/cmds/pack.go +++ b/cmd/pkger/cmds/pack.go @@ -147,6 +147,7 @@ func Package(info here.Info, out string, decls parser.Decls) error { name = "main" } + fmt.Fprintf(f, "// Code generated by pkger; DO NOT EDIT.\n\n", name) fmt.Fprintf(f, "package %s\n\n", name) fmt.Fprintf(f, "import (\n\t\"github.com/markbates/pkger\"\n\t") fmt.Fprintf(f, "\"github.com/markbates/pkger/pkging/mem\"\n)\n\n")