Add comments containing source file to generated files

This commit is contained in:
2023-01-07 15:05:40 -08:00
parent df0dc254c3
commit 018527cbd4
37 changed files with 48 additions and 1 deletions

View File

@@ -89,6 +89,11 @@ func main() {
}
defer outFl.Close()
_, err = outFl.WriteString("// Source: " + path + "\n")
if err != nil {
return err
}
return generator.NewStruct(outFl, "types").Generate(fileStructs)
})
if err != nil {
@@ -135,7 +140,8 @@ func main() {
}
}
rf, err := os.Open(filepath.Join(*lemmyDir, routesFile))
routesPath := filepath.Join(*lemmyDir, routesFile)
rf, err := os.Open(routesPath)
if err != nil {
panic(err)
}
@@ -153,6 +159,11 @@ func main() {
}
defer orf.Close()
_, err = orf.WriteString("// Source: " + routesPath + "\n")
if err != nil {
panic(err)
}
err = generator.NewRoutes(orf, "lemmy").Generate(routes, impls)
if err != nil {
panic(err)