Add header comment to generated files

This commit is contained in:
Elara 2023-01-07 14:40:18 -08:00
parent 3ff5c01653
commit bcc3bf8716
2 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,8 @@ func NewRoutes(w io.Writer, pkgName string) *RoutesGenerator {
func (r *RoutesGenerator) Generate(routes []parser.Route, impls map[string]string) error {
f := jen.NewFile(r.PkgName)
f.HeaderComment("Code generated by go.arsenm.dev/go-lemmy/cmd/gen (routes generator). DO NOT EDIT.")
for _, r := range routes {
resStruct := impls[r.Struct]

View File

@ -19,6 +19,8 @@ func NewStruct(w io.Writer, pkgName string) *StructGenerator {
func (s *StructGenerator) Generate(items []parser.Item) error {
f := jen.NewFile(s.PkgName)
f.HeaderComment("Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.")
for _, item := range items {
if item.Struct != nil {
st := item.Struct