mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-06 17:10:34 +07:00
gracefull shutdown for unresolvable errors
This commit is contained in:
5
main.go
5
main.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user