gracefull shutdown for unresolvable errors

This commit is contained in:
2025-03-07 21:40:53 +07:00
parent 2fd8b20b77
commit e6f21d1bb2
19 changed files with 181 additions and 133 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"log"
"nto_cli/cmd"
"nto_cli/generation"
"nto_cli/utils"
@@ -8,13 +9,13 @@ import (
)
func main() {
log.SetFlags(0)
structNames, path := cmd.SelectionInput()
for _, structName := range structNames {
file, err := os.Open(path)
defer file.Close()
if err != nil {
panic(err)
log.Fatalf("Failed to open file: %s", err)
}
structFields := utils.GetStructFields(file, structName)
generation.Generate(structName, structFields)