printer: add generated code warnings

This commit is contained in:
Michael McLoughlin
2018-12-18 22:57:26 -08:00
parent 213d65e481
commit ca5c7e7454
17 changed files with 94 additions and 9 deletions

View File

@@ -15,8 +15,11 @@ func NewStubs(cfg Config) Printer {
}
func (s *stubs) Print(f *avo.File) ([]byte, error) {
s.Printf("package %s\n\n", s.cfg.Pkg)
s.Comment(s.cfg.GeneratedWarning())
s.NL()
s.Printf("package %s\n", s.cfg.Pkg)
for _, fn := range f.Functions {
s.NL()
s.Printf("%s\n", fn.Stub())
}
return s.Result()