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
This commit is contained in:
Hannes Gustafsson 2020-02-16 19:49:51 +00:00
parent d9d5139985
commit 4e1fe7b43f
1 changed files with 1 additions and 0 deletions

View File

@ -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")