From 8e0208dec2855692074f35672549ce39894a1783 Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Sat, 7 Jan 2023 14:40:18 -0800 Subject: [PATCH] Add header comment to generated files --- cmd/gen/generator/routes.go | 2 ++ cmd/gen/generator/struct.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmd/gen/generator/routes.go b/cmd/gen/generator/routes.go index fb1ba88..efe1914 100644 --- a/cmd/gen/generator/routes.go +++ b/cmd/gen/generator/routes.go @@ -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] diff --git a/cmd/gen/generator/struct.go b/cmd/gen/generator/struct.go index 10faaa4..424279b 100644 --- a/cmd/gen/generator/struct.go +++ b/cmd/gen/generator/struct.go @@ -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